I'm trying to use printf with empty parameters, like:
printf("Just a debug string")
Currently, I get a compiler error with the original code.
The solution is to change these lines:
|
#define sprintf(buff, str, ...) GString(buff).printf(str, __VA_ARGS__) |
|
#define xprintf(out, str, ...) PrintEx(out).PRINTF_ALIAS(str, __VA_ARGS__) |
|
#define printf(format, ...) PRINTF_ALIAS(format, __VA_ARGS__) |
To:
#define sprintf(buff, str, ...) GString(buff).printf(str, ##__VA_ARGS__)
#define xprintf(out, str, ...) PrintEx(out).PRINTF_ALIAS(str, ##__VA_ARGS__)
#define printf(format, ...) PRINTF_ALIAS(format, ##__VA_ARGS__)
Note the leading ## in __VA_ARGS__
I'm trying to use printf with empty parameters, like:
Currently, I get a compiler error with the original code.
The solution is to change these lines:
PrintEx/src/lib/PrintExtension.h
Lines 202 to 203 in 7e13cfc
PrintEx/src/lib/PrintExtension.h
Line 208 in 7e13cfc
To:
Note the leading ## in
__VA_ARGS__