X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/267dd3e78997ba6f5a0801c0afab2148dd049f16..c2438e62e7c3cf1b7006522cef61e8c6f797600b:/lib/sod.h?ds=sidebyside diff --git a/lib/sod.h b/lib/sod.h index 919b927..8270895 100644 --- a/lib/sod.h +++ b/lib/sod.h @@ -53,7 +53,7 @@ struct sod_vtable { * these. */ struct sod_instance { - struct sod_vtable *_vt; /* Pointer to (chain's) vtable */ + const struct sod_vtable *_vt; /* Pointer to (chain's) vtable */ }; /* Information about a particular chain of superclasses. In each class, @@ -124,6 +124,18 @@ struct sod_chain { ((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@ --- *