From c9bb41bd9ca6fc2ebd1c8be150e41c52ab50e3c7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 14 May 2026 16:52:40 -0700 Subject: [PATCH] Fixed build when GameInput is enabled --- src/core/windows/SDL_gameinput.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/windows/SDL_gameinput.h b/src/core/windows/SDL_gameinput.h index 6969ad0dd2..ea16b85dce 100644 --- a/src/core/windows/SDL_gameinput.h +++ b/src/core/windows/SDL_gameinput.h @@ -23,7 +23,7 @@ #ifndef SDL_gameinput_h_ #define SDL_gameinput_h_ -#ifdef HAVE_GAMEINPUT_H +#if defined(HAVE_GAMEINPUT_H) && defined(__cplusplus) #ifdef HAVE_GCC_DIAGNOSTIC_PRAGMA #pragma GCC diagnostic push @@ -59,14 +59,16 @@ extern bool SDL_InitGameInput(IGameInput **ppGameInput); extern bool SDL_GameInputReady(void); extern void SDL_QuitGameInput(void); -#endif // HAVE_GAMEINPUT_H +#endif // HAVE_GAMEINPUT_H && __cplusplus +/* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif extern bool SDL_UsingGameInputForXInputControllers(void); +/* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif