I have am getting:
fatal error C1017: invalid integer constant expression
with the following piece of code:
#if V1>0
//do stuff
#endif
V1 is defined as follows at the top of the .cpp file:
#define V3 UINT32
#define V4 sizeof(V3)
#define V1 (V2 % V4)
V2 is defined as follows:
const int V2 = 256;
Can anybody see where I am going wrong?
try
instead of
Edit: There is some good reason you’re doing preprocessor macros instead of just regular branching, right?
Edit 2: As someone else pointed out, the preprocessor does not accept sizeof statements, as these are handled by the compiler. Your options are to use a programmatic if statement (as opposed to a preprocessor one) or to use the real value of the size expression (which would involve hardcoding the size. However, since it’s a UINT32, I don’t think it will ever be anything other than 4.