User Profile
Collapse
-
Thank you very much, I understand what I'm doing wrong now.... -
Shouldn't the "..." allow 0 or more arguments? so that the below should accept 3 arguments or more.
#define LOG(level, device, pcString, ...) \
if (level < SERIAL_LOG_LEVE L) _log(device, pcString, ## __VA_ARGS__)
Shouldn't it?
Thank you....Leave a comment:
-
Ok, that works with 1 or more arguments, but if i do
LOG(1, 0, "hello world");
compiler says too few argument in macro.
I'm using IAR by the way.
Thank you....Leave a comment:
-
#define macro with multiple parrams
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,...
No activity results to display
Show More
Leave a comment: