I occasionally write code something like this:
// file1.cpp #define DO_THIS 1 #if DO_THIS // stuff #endif
During the code development I ma
If you're desperate to prevent this kind of error, try the following which uses preprocessor token-pasting magic and expression evaluation to enforce that a macro is defined (and 0 in this example):
#define DEFINED_VALUE(x,y) (defined (y##x) ? x : 1/x) #if DEFINED_VALUE(FEATURE1,) == 0