diff --git a/config.d/compiling.m4 b/config.d/compiling.m4 index 508c43775..c3f71c5d7 100644 --- a/config.d/compiling.m4 +++ b/config.d/compiling.m4 @@ -320,6 +320,25 @@ if test "x$GCC" != xyes -a "x$CLANG" != xyes -a "x$leave_cflags_alone" != xyes; esac fi +if test "x$leave_cflags_alone" != xyes; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[bool flag = true;]], + [[return flag ? 1 : 0]])], + [], + [QF_CC_OPTION(-std=gnu2x)] + ) +fi +AC_MSG_CHECKING([for c23]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[bool flag = true;] + [int bar (void);]], + [[return bar();]])], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(QuakeForge requires C23 to compile)] +) + AS="$CC" if test "x$SYSTYPE" = "xWIN32"; then ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES) -D_WIN32" diff --git a/include/QF/qtypes.h b/include/QF/qtypes.h index c90691d06..6986fc867 100644 --- a/include/QF/qtypes.h +++ b/include/QF/qtypes.h @@ -52,25 +52,6 @@ typedef uint8_t byte; #endif -#if __STDC_VERSION__ < 202000 || defined(__clang__) -# define auto __auto_type -#endif - -#if __STDC_VERSION__ < 202000 -# ifndef _DEF_BOOL_ -# define _DEF_BOOL_ -// KJB Undefined true and false defined in SciTech's DEBUG.H header -# ifdef __cplusplus -# define __bool_true_false_are_defined -# endif -# ifndef __bool_true_false_are_defined -# undef true -# undef false -typedef enum {false, true} bool; -# endif -# endif -#endif - // From mathlib... typedef float vec_t; ///< The basic vector component type typedef vec_t vec3_t[3]; ///< A 3D vector (used for Euler angles and motion vectors)