From e71dfe1fffec401bf81c5d003545a78a42ced7ee Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 4 Jun 2026 09:09:55 +0200 Subject: [PATCH] Requires C99 --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 74185dd1..2f7d6dc8 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,22 @@ AC_CHECK_PROG([SDE],[sde64],[sde64],[]) AC_CHECK_PROG([ADVD2],[advd2],[advd2],[]) AM_CONDITIONAL(HAVE_ADVD2, [test x"$ADVD2" != x]) +# Compile a quick test program using a syntax unique to C99 and newer +AC_MSG_CHECKING([if compiler supports C99 or newer features]) +AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[]], [[ + int x = 0; + x++; + int y = x; + int array[y]; + ]]) +], [ + AC_MSG_RESULT([yes]) +], [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([A C99-compliant compiler or newer is required to build this package.]) +]) + # Check if we are targeting Windows is_windows=no AS_CASE([$host_os], [mingw*|msys*|cygwin*], [is_windows=yes])