mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-08 19:06:26 +00:00
SDL_stdinc.h (SDL_COMPILE_TIME_ASSERT): Keep C++ case alone (after PR/10331)
Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. Reference issue: https://github.com/libsdl-org/SDL/issues/6078 which was fixed byf6b81125b3
(cherry picked from commit70c1012e8c
) (cherry picked from commit86b4d035db
)
This commit is contained in:
@@ -376,7 +376,12 @@ typedef uint64_t Uint64;
|
|||||||
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
||||||
|
|
||||||
#ifndef SDL_COMPILE_TIME_ASSERT
|
#ifndef SDL_COMPILE_TIME_ASSERT
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
|
#if defined(__cplusplus)
|
||||||
|
/* Keep C++ case alone: Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. */
|
||||||
|
#if (__cplusplus >= 201103L)
|
||||||
|
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
||||||
|
#endif
|
||||||
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
||||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x)
|
#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x)
|
||||||
|
Reference in New Issue
Block a user