M
Maksim Sipos
Hello,
I would like to have something like
#ifdef VERSION_DEBUG
#define DEBUG(x) DebugFnc(x)
#end
#ifdef VERSION_RELEASE
#define DEBUG(x) <empty-statement>
#end
but I'm not sure how to implement the empty statement.. the problem, of
course is in the extra semicolon when the macro is called as in,
DEBUG(x); in release version. One of the possible solutions is to set
#define DEBUG(x) do{}while(0)
but I am not sure whether the compiler is smart enough
to optimize this. Any other ideas, comments?
I would like to have something like
#ifdef VERSION_DEBUG
#define DEBUG(x) DebugFnc(x)
#end
#ifdef VERSION_RELEASE
#define DEBUG(x) <empty-statement>
#end
but I'm not sure how to implement the empty statement.. the problem, of
course is in the extra semicolon when the macro is called as in,
DEBUG(x); in release version. One of the possible solutions is to set
#define DEBUG(x) do{}while(0)
but I am not sure whether the compiler is smart enough
to optimize this. Any other ideas, comments?