Skip to content

Commit 975620b

Browse files
Revert "compat: Use standard bool to resolve C99+ keyword conflicts (#18)"
This reverts commit 4885126.
1 parent 4885126 commit 975620b

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/doomtype.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,22 @@
6565

6666
#include <inttypes.h>
6767

68-
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus)
69-
// For C99+ and C++, use the standard boolean type
70-
#include <stdbool.h>
68+
#ifdef __cplusplus
69+
70+
// Use builtin bool type with C++.
71+
72+
typedef bool bool;
73+
7174
#else
72-
// For older C standards, use the original custom enum
73-
typedef enum { false = 0, true = 1 } bool;
74-
#endif
7575

76-
// The original enum also defined an 'undef' state.
77-
// left for compatibility
78-
enum {
79-
undef = 0xFFFFFFFF
80-
};
76+
typedef enum
77+
{
78+
false = 0,
79+
true = 1,
80+
undef = 0xFFFFFFFF
81+
} bool;
82+
83+
#endif
8184

8285
typedef uint8_t byte;
8386

0 commit comments

Comments
 (0)