With the new C99
standard, it is possible to write macro
s with a variable number of arguments ("variadic
"), just like it is possible to write such functions. This is especially useful for wrapping variadic functions in macros.
The syntax used is an ellipsis in in the argument list. The string
__VA_ARGS__ in the expansion is replaced with the arguments.
As an example, the ubiquitous eprintf macro:
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
which could be invoked like
eprintf("error %d occured in %s\n", error_no, module);