mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 19:55:19 +00:00
stdinc: only use _Countof for SDL_arraysize when using a C standard > C23
This commit is contained in:
parent
687a59f277
commit
dd0536b170
1 changed files with 2 additions and 1 deletions
|
|
@ -256,7 +256,8 @@ void *alloca(size_t);
|
|||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) /* or `_Countof(array)` on recent gcc and clang */
|
||||
|
||||
#else
|
||||
#if !defined(__cplusplus) && ((defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof))
|
||||
#if !defined(__cplusplus) && ((defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof)) \
|
||||
&& (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202500L)
|
||||
#define SDL_arraysize(array) _Countof(array)
|
||||
#else
|
||||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue