[build] Require C23 (gnu2x)

Now that gcc-13 is default on Debian sid, I'm happy to switch to
requiring it for building QF. As a celebration, I removed the bool and
auto hacks.
This commit is contained in:
Bill Currie 2023-08-13 22:52:38 +09:00
parent a3e99435df
commit 77842bdeb4
2 changed files with 19 additions and 19 deletions

View File

@ -320,6 +320,25 @@ if test "x$GCC" != xyes -a "x$CLANG" != xyes -a "x$leave_cflags_alone" != xyes;
esac esac
fi 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" AS="$CC"
if test "x$SYSTYPE" = "xWIN32"; then if test "x$SYSTYPE" = "xWIN32"; then
ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES) -D_WIN32" ASFLAGS="\$(DEFS) \$(CFLAGS) \$(CPPFLAGS) \$(DEFAULT_INCLUDES) \$(INCLUDES) -D_WIN32"

View File

@ -52,25 +52,6 @@
typedef uint8_t byte; typedef uint8_t byte;
#endif #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... // From mathlib...
typedef float vec_t; ///< The basic vector component type 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) typedef vec_t vec3_t[3]; ///< A 3D vector (used for Euler angles and motion vectors)