diff --git a/Quake/q_stdinc.h b/Quake/q_stdinc.h index bbf21c78c..c8bd4b4e4 100644 --- a/Quake/q_stdinc.h +++ b/Quake/q_stdinc.h @@ -126,27 +126,23 @@ COMPILE_TIME_ASSERT(enum, sizeof(THE_DUMMY_ENUM) == sizeof(int)); typedef unsigned char byte; -#undef true -#undef false -#if defined(__cplusplus) /* some structures have qboolean members and the x86 asm code expect - * those members to be 4 bytes long. therefore, qboolean must be 32 - * bits and it can NOT be binary compatible with the 8 bit C++ bool. */ + * those members to be 4 bytes long. i.e.: qboolean must be 32 bits. */ typedef int qboolean; -COMPILE_TIME_ASSERT(falsehood, (0 == false)); -COMPILE_TIME_ASSERT(truth, (1 == true)); -#else -#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L -typedef int qboolean; /* C23: true/false are keywords. */ +#undef true +#undef false +#if !defined(__cplusplus) +#if defined __STDC_VERSION__ && (__STDC_VERSION__ >= 199901L) +#include #else -typedef enum { +enum { false = 0, true = 1 -} qboolean; +}; #endif +#endif /* */ COMPILE_TIME_ASSERT(falsehood, ((1 != 1) == false)); COMPILE_TIME_ASSERT(truth, ((1 == 1) == true)); -#endif COMPILE_TIME_ASSERT(qboolean, sizeof(qboolean) == 4); /*==========================================================================*/