SDL: Fixed build when virtual joysticks are disabled

From fbdb6379781f2874860fe3079f452ec1efbca1ac Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 21 Mar 2025 07:34:57 -0700
Subject: [PATCH] Fixed build when virtual joysticks are disabled

---
 src/joystick/SDL_joystick.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index e88dde63f81a6..28fa12bd4e8f2 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -1122,7 +1122,9 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id)
     joystick->attached = true;
     joystick->led_expiration = SDL_GetTicks();
     joystick->battery_percent = -1;
+#ifdef SDL_JOYSTICK_VIRTUAL
     joystick->is_virtual = (driver == &SDL_VIRTUAL_JoystickDriver);
+#endif
 
     if (!driver->Open(joystick, device_index)) {
         SDL_SetObjectValid(joystick, SDL_OBJECT_TYPE_JOYSTICK, false);