diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 45f1baee92..a6990e53c8 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -388,10 +388,8 @@ typedef uint64_t Uint64; #endif /* SDL_DISABLE_ANALYZE_MACROS */ #ifndef SDL_COMPILE_TIME_ASSERT -#if defined(__cplusplus) -#if (__cplusplus >= 201103L) +#if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) #define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) -#endif #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) #define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x) #endif