Hi,
I'm trying to define a macro that calls a log function:
#define LOG(level, device, pcString, args ...) if (level < SERIAL_LOG_LEVE L) _log(device, pcString, ## args)
void _log (unsigned char device, const char *pcString, ...);
I want the macro to accept multiple args with "..." but the compiler didn't like it. It works fine if i simply do.
#define LOG(level, device, pcString, args ) if (level < SERIAL_LOG_LEVE L) _log(device, pcString, ## args)
and when i call
d = 0;
LOG(1, 0, "hello world %d", d);
What am i doing wrong?
Thank you for your help.
Regards,
John
I'm trying to define a macro that calls a log function:
#define LOG(level, device, pcString, args ...) if (level < SERIAL_LOG_LEVE L) _log(device, pcString, ## args)
void _log (unsigned char device, const char *pcString, ...);
I want the macro to accept multiple args with "..." but the compiler didn't like it. It works fine if i simply do.
#define LOG(level, device, pcString, args ) if (level < SERIAL_LOG_LEVE L) _log(device, pcString, ## args)
and when i call
d = 0;
LOG(1, 0, "hello world %d", d);
What am i doing wrong?
Thank you for your help.
Regards,
John
Comment