-
typedef enum question
Just have a quick question, hopefully someone will be able
to answer quickly.
Trying to do something rather simple:
typedef enum { FALSE, TRUE } fboolean;
This works with the stand c header files.
Why does it break when I include windows.h file?
I get errors such as:
Code:
(57): error C2143: syntax error : missing '}' before 'constant'
Any help would be appreciated.
-
Because windows.h defines FALSE as 0 and TRUE as 1, which means your enum statement is
enum { 0, 1 }
Either #undef both, or use different names.
-
It may even be a better plan to include windows.h and just use the internal definitions for TRUE and FALSE. While you're at it why not just use BOOL ;)