/*
* Type: bool
* ----------
* This type has two values, FALSE and TRUE, which are equal to 0
* and 1, respectively. Most of the advantage of defining this type
* comes from readability because it allows the programmer to
* provide documentation that a variable will take on only one of
* these two values. Designing a portable representation, however,
* is surprisingly hard, because many libraries and some compilers
* define these names. The definitions are usually compatible but
* may still be flagged as errors.
*/
#ifdef THINK_C
typedefintbool;
#else
# ifdef TRUE
# ifndef bool
# define bool int
# endif
# else
# ifdef bool
# define FALSE 0
# define TRUE 1
# else
typedefenum {FALSE, TRUE} bool;
# endif
# endif
#endif
this line of code "typedef enum {FALSE, TRUE} bool;" results in the error "error C2628: '<unnamed-tag>' followed by 'bool' is illegal (did you forget a ';'?)"
This is really confusing since this code has been around since 1994 and works fine, so why is the build puking this up now?
Because you use C++ now, not C? The code is written to be used in C. C++ has it's own boolean data type called bool (same name as they try to name the enum type).