c++ - how to Ignore definitions (VS2008) -
I have some source code that I want to compile with VS 2008 but I have many errors which I have to fix . Now something like this is:
enum {background = 0x00000001, WEAPON = 0x00000002, TRANSPARENT = 0x00000004}
The problem is that TRANSPARENT is defined WinGDI.h
This would be a compilation error: To correct this error, delete the field without enum and WinGDI It is possible to rename without Transparent 1
Error C2143: Syntax Error: Before 'continuous' is disappearing '}'
You can use
#undef TRANSPARENT
but due to errors There may be other reasons, if WinGDI transients are used later, the solution may be a (messy) solution:
#ifdef TRANSPARENT #define _TRANSPARENT TRANSPARENT #undef TRANSPARENT #ENDIF
and after your code:
#ifdef _TRANSPARENT #transportant _TRANSPARENT #endif
Comments
Post a Comment