From f4ddacacd041c8994c87877b0e1520e4da735c6e Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 24 Jul 2025 10:42:28 -0700
Subject: [PATCH] Fixed building with GameInput v1.0
(cherry picked from commit 0ee0fe157218476ff39d2213d726d260b6468f7d)
---
src/joystick/gdk/SDL_gameinputjoystick.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/joystick/gdk/SDL_gameinputjoystick.c b/src/joystick/gdk/SDL_gameinputjoystick.c
index 1e729b93528cd..d7b11351142a1 100644
--- a/src/joystick/gdk/SDL_gameinputjoystick.c
+++ b/src/joystick/gdk/SDL_gameinputjoystick.c
@@ -158,7 +158,11 @@ static bool GAMEINPUT_InternalAddOrFind(IGameInputDevice *pDevice)
elem->guid = SDL_CreateJoystickGUID(bus, vendor, product, version, manufacturer_string, product_string, 'g', 0);
elem->device_instance = SDL_GetNextObjectID();
elem->info = info;
+#if GAMEINPUT_API_VERSION >= 1
elem->steam_virtual_gamepad_slot = GetSteamVirtualGamepadSlot(info->pnpPath);
+#else
+ elem->steam_virtual_gamepad_slot = -1;
+#endif
g_GameInputList.devices = devicelist;
g_GameInputList.devices[g_GameInputList.count++] = elem;