From 2fa7ba1e4fe54918be75a9a466b9ae51fbe14d60 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 14 May 2026 17:36:57 +0200 Subject: [PATCH] stdinc: _Countof is only available in C mode --- include/SDL3/SDL_stdinc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 3e2266dc8f..893f2052f7 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -256,7 +256,7 @@ void *alloca(size_t); #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) /* or `_Countof(array)` on recent gcc and clang */ #else -#if (defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof) +#if !defined(__cplusplus) && ((defined(__GNUC__) && __GNUC__ >= 16) || SDL_HAS_EXTENSION(c_countof)) #define SDL_arraysize(array) _Countof(array) #else #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))