Originally Posted by
laserlight
I can't say I've ever had reason to use the feature myself, but variadic macros were introduced in C99.
Thanks, the term variadic saved me there. It seems like they work with -std=gcc89? Is that ten years before C99? Well.
You are passing everything through a call to a function. You can make that function into a varargs function by declaring parameters with '...', and then call
vfprintf instead of fprintf, passing the va_list parameter.
Thanks a lot. This time, for me, it is actually not necessary because 'fprintf' already accepts a variable number of arguments.
My result was
Code:
#define PRINT_ONCE(...) \
do { \
static bool fixme_written = 0;\
if (!fixme_written) \
{\
fixme_written = 1; \
fprintf(stderr, __VA_ARGS__); \
} \
} while (0)