diff --git a/src/flint.h.in b/src/flint.h.in index dd24a3d068..c6b79d78e8 100644 --- a/src/flint.h.in +++ b/src/flint.h.in @@ -148,16 +148,22 @@ typedef struct __FLINT_FILE FLINT_FILE; # define FLINT_OPTIMIZE(x) #endif -#if __STDC_VERSION__ < 201112L +#ifdef __cplusplus +# define FLINT_C_VERSION __cplusplus +#else +# define FLINT_C_VERSION __STDC_VERSION__ +#endif + +#if FLINT_C_VERSION < 201112L # error FLINT requires C11 or newer. -#elif __STDC_VERSION__ < 202300L +#elif FLINT_C_VERSION < 202300L # define FLINT_NORETURN _Noreturn #else # define FLINT_NORETURN noreturn #endif #if FLINT_USES_TLS -# if __STDC_VERSION__ < 202300L +# if FLINT_C_VERSION < 202300L # define FLINT_TLS_PREFIX _Thread_local # else # define FLINT_TLS_PREFIX thread_local