Late to the party, but I found a good trick to distinguish
#define TRACING 0
from
#define DTRACING
like this:
#if (0-TRACING-1)==1 && (TRACING+0)!=-2 #error "tracing empty" #endif
If TRACING empty, the expression evaluates to 0--1 => 1 .
If TRACING is 0, the expression evaluates to 0-0-1 => -1
I added an additional check in case of TRACING==-2 which will make the first test pass.
This does not work for string literals, of course.
Jean-François Fabre Jan 31 '18 at 10:36 2018-01-31 10:36
source share