M
Michael B Allen
If I define a variadic macro like say:
#define PRINT(fmt, ...) _myprintf(__FILE__ ": " fmt, __VA_ARGS__)
and I call this like:
PRINT("no args");
the preprocessor generates:
_myprintf("file.c" ": " "no args",);
which isn't going to work because of the comma. Is there a workaround?
This seems like a drab oversight in variadic macros.
Mike
#define PRINT(fmt, ...) _myprintf(__FILE__ ": " fmt, __VA_ARGS__)
and I call this like:
PRINT("no args");
the preprocessor generates:
_myprintf("file.c" ": " "no args",);
which isn't going to work because of the comma. Is there a workaround?
This seems like a drab oversight in variadic macros.
Mike