I have the following code in a global header, so I can make decisions at compile time:
enum {
MyStyleA,
MyStyleB,
MyStyleC
};
#define STYLE MyStyleB
In various source files, I include this header and do something like this:
#if STYLE == MyStyleC
doSomething();
#endif
Problem is, doSomething()
definitely gets executed even though I defined STYLE
to MyStyleB
in the header!
Any idea what's going wrong here?
(I admit I am no C preprocessor expert.)