Browse Source

stdinc: c23 deprecated _Static_assert in favor of static_assert

(cherry picked from commit 22bfbdbc020bf42622bbeb1e70df6cd2a692136f)
(cherry picked from commit 5d606eaae27311a36ff48437a7235a38e3525608)
Anonymous Maarten 9 months ago
parent
commit
e53df5b07e
1 changed files with 1 additions and 3 deletions
  1. 1 3
      include/SDL_stdinc.h

+ 1 - 3
include/SDL_stdinc.h

@@ -376,10 +376,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