In a current project, I'm experimenting around a lot to see the performance influence of different solutions. Since I like to keep all the code, I have a lot of #ifdef directives, which make it easy for me to switch on and off some optimizations. However, some combinations of defines are not covered. I'd like to see a compiler error if this happens, i.e.:
#define A
#define B
#ifdef A
#ifdef B
//invalid combination of defines. Compiler should raise an error.
#endif
#endif
#ifdef A
//do something
#endif
#ifdef B
//do something else
#endif
Is that possible?