It's now called `SOD__CAR', no longer documented, and in a new, clearly
marked `preliminaries utilities' section of the header file. This new
section precedes the header-file inclusions because they can in
principle depend on the definitions made here.
This macro probably won't change, but I reserve the right to make the
internal utilities be weird in ways which won't break the way Sod uses
them, but might break other things which rely on them.
@|SOD_INSTBASE| macro (described below) is more suited to general use.
\end{describe}
@|SOD_INSTBASE| macro (described below) is more suited to general use.
\end{describe}
-\begin{describe}[SOD_CAR]{mac} {@<arg> SOD_CAR(@<arg>, @<other-arg>^*);}
- Accepts one or more arguments and expands to just its first argument,
- discarding the others.
-
- It is only defined if the C implementation advertises support for C99. It
- is used in the definitions of message convenience macros for messages which
- accept a variable number of arguments but no required arguments, and is
- exported because the author has found such a thing useful in other
- contexts.
-\end{describe}
-
%%%--------------------------------------------------------------------------
\section{Utility macros} \label{sec:runtime.utility}
%%%--------------------------------------------------------------------------
\section{Utility macros} \label{sec:runtime.utility}
.IB cls ,
.IB chead ,
.BI "const void *" obj );
.IB cls ,
.IB chead ,
.BI "const void *" obj );
-.br
-.B SOD_CAR(\c
-.IB arg ,
-.RB ... );
.PP
.B const void *\c
.B SOD_CLASSOF(\c
.PP
.B const void *\c
.B SOD_CLASSOF(\c
The
.B SOD_INSTBASE
macro (described below) is more suited to general use.
The
.B SOD_INSTBASE
macro (described below) is more suited to general use.
-.PP
-The
-.B SOD_CAR
-macro accepts one or more arguments
-and expands to just its first argument,
-discarding the others.
-It is only defined if the C implementation
-advertises support for C99.
-It is used in the definitions of message convenience macros
-for messages which accept a variable number of arguments
-but no required arguments,
-and is exported because the author has found such a thing useful in
-other contexts.
.
.SS Utility macros
The following macros are expected to be useful
.
.SS Utility macros
The following macros are expected to be useful
+/*----- Preliminary utilities ---------------------------------------------*/
+
+/* --- @SOD__CAR@ --- *
+ *
+ * Arguments: @...@ = a nonempty list of arguments
+ *
+ * Returns: The first argument only.
+ */
+
+#if __STDC_VERSION__ >= 199901
+# define SOD__CAR(...) SOD__CARx(__VA_LIST__, _)
+# define SOD__CARx(a, ...) a
+#endif
+
/*----- Header files ------------------------------------------------------*/
#include <stdarg.h>
/*----- Header files ------------------------------------------------------*/
#include <stdarg.h>
((struct cls##__ilayout *) \
((char *)(obj) - offsetof(struct cls##__ilayout, chead)))
((struct cls##__ilayout *) \
((char *)(obj) - offsetof(struct cls##__ilayout, chead)))
-/* --- @SOD_CAR@ --- *
- *
- * Arguments: @...@ = a nonempty list of arguments
- *
- * Returns: The first argument only.
- */
-
-#if __STDC_VERSION__ >= 199901
-# define SOD_CAR(...) SOD__CARx(__VA_LIST__, _)
-# define SOD__CARx(a, ...) a
-#endif
-
/*----- Utility macros ----------------------------------------------------*/
/* --- @SOD_CLASSOF@ --- *
/*----- Utility macros ----------------------------------------------------*/
/* --- @SOD_CLASSOF@ --- *
raw-name)))
(cond ((and (cdr args) (eq (cadr args) :ellipsis))
(setf varargsp t)
raw-name)))
(cond ((and (cdr args) (eq (cadr args) :ellipsis))
(setf varargsp t)
- (unless in-names (setf me "SOD_CAR(__VA_ARGS__)"))
+ (unless in-names (setf me "SOD__CAR(__VA_ARGS__)"))
(push (format nil "/*~A*/ ..." name) in-names)
(push "__VA_ARGS__" out-names)
(return))
(push (format nil "/*~A*/ ..." name) in-names)
(push "__VA_ARGS__" out-names)
(return))