Original Post
I have a printf() like function which I use to print debug messages to a log file and to the debugger. Now, I want all calls to this func to be removed in the release mode. So what I have to do is check whether NDEBUG is defined and then #define the function call away.
But, the function has a variable number of arguments, so how do I define a macro for it with multiple args ??
I have :
void func(char* msg, ...);
what I want to do :
#ifdef DEBUG
#define macro(X,Y) func(X,Y)
#else
#define macro(X,Y)
#endif
But func can have any number of args, not only two. So what do i do?