We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd07b14 commit 4885126Copy full SHA for 4885126
src/doomtype.h
@@ -65,23 +65,20 @@
65
66
#include <inttypes.h>
67
68
-#ifdef __cplusplus
69
-
70
-// Use builtin bool type with C++.
71
72
-typedef bool bool;
73
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus)
+// For C99+ and C++, use the standard boolean type
+#include <stdbool.h>
74
#else
75
76
-typedef enum
77
-{
78
- false = 0,
79
- true = 1,
80
- undef = 0xFFFFFFFF
81
-} bool;
82
+// For older C standards, use the original custom enum
+typedef enum { false = 0, true = 1 } bool;
83
#endif
84
+// The original enum also defined an 'undef' state.
+// left for compatibility
+enum {
+ undef = 0xFFFFFFFF
+};
+
85
typedef uint8_t byte;
86
87
#include <limits.h>
0 commit comments