Skip to content

Commit

Permalink
fix build in C23 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed May 7, 2024
1 parent 8ab55df commit ede7dd0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Quake/q_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef __QSTDINC_H
#define __QSTDINC_H
#ifndef QSTDINC_H
#define QSTDINC_H

#include <sys/types.h>
#include <stddef.h>
Expand Down Expand Up @@ -136,10 +136,14 @@ 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. */
#else
typedef enum {
false = 0,
true = 1
} qboolean;
#endif
COMPILE_TIME_ASSERT(falsehood, ((1 != 1) == false));
COMPILE_TIME_ASSERT(truth, ((1 == 1) == true));
#endif
Expand Down Expand Up @@ -244,6 +248,4 @@ typedef ptrdiff_t ssize_t;

/*==========================================================================*/


#endif /* __QSTDINC_H */

#endif /* QSTDINC_H */

0 comments on commit ede7dd0

Please sign in to comment.