# the compiler has a different built-in setting)
STD_CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
+#
+# Define constexpr if it is missing from the compiler
+#
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[constexpr int foo = 0;]])],
+ [],
+ [AC_DEFINE([constexpr],[static const],[Define compatibility shim for non-C23 compilers.])])
+
#
# Additional compiler settings.
#
#else
#define ISC_ATTR_UNUSED __attribute__((__unused__))
#endif
-
-#if __STDC_VERSION__ >= 202311L
-#define ISC_CONSTEXPR constexpr
-#else
-#define ISC_CONSTEXPR static const
-#endif
#include <inttypes.h>
#include <time.h>
-#include <isc/attributes.h>
#include <isc/types.h>
/*
* Define various time conversion constants.
*/
-ISC_CONSTEXPR unsigned int MS_PER_SEC = 1000;
-ISC_CONSTEXPR unsigned int US_PER_MS = 1000;
-ISC_CONSTEXPR unsigned int NS_PER_US = 1000;
-ISC_CONSTEXPR unsigned int US_PER_SEC = 1000 * 1000;
-ISC_CONSTEXPR unsigned int NS_PER_MS = 1000 * 1000;
-ISC_CONSTEXPR unsigned int NS_PER_SEC = 1000 * 1000 * 1000;
+constexpr unsigned int MS_PER_SEC = 1000;
+constexpr unsigned int US_PER_MS = 1000;
+constexpr unsigned int NS_PER_US = 1000;
+constexpr unsigned int US_PER_SEC = 1000 * 1000;
+constexpr unsigned int NS_PER_MS = 1000 * 1000;
+constexpr unsigned int NS_PER_SEC = 1000 * 1000 * 1000;
/*
* ISC_FORMATHTTPTIMESTAMP_SIZE needs to be 30 in C locale and potentially