Trying to create a macro which can be used for print debug messages when DEBUG is defined, like the following pseudo code:
#define DEBUG 1 #define debug_prin
I would do something like
#ifdef DEBUG #define debug_print(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__) #else #define debug_print(fmt, ...) do {} while (0) #endif
I think this is cleaner.