From 89884075d56119b71151fb248460348b46c4acf7 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 15:30:35 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_XINPUT --- src/joystick/SDL_gamepad.c | 2 +- src/joystick/SDL_gamepad_db.h | 2 +- src/joystick/windows/SDL_windowsjoystick.c | 4 ++-- src/joystick/windows/SDL_xinputjoystick.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 3919e95900..cda636118d 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -814,7 +814,7 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMappingForGUID(SDL_JoystickGUID gu } } -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT if (SDL_IsJoystickXInput(guid)) { /* This is an XInput device */ return s_pXInputMapping; diff --git a/src/joystick/SDL_gamepad_db.h b/src/joystick/SDL_gamepad_db.h index 12ad233687..f9a3b68226 100644 --- a/src/joystick/SDL_gamepad_db.h +++ b/src/joystick/SDL_gamepad_db.h @@ -29,7 +29,7 @@ Alternatively, you can use the app located in test/controllermap */ static const char *s_GamepadMappings[] = { -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT "xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", #endif #if SDL_JOYSTICK_WGI diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index d6b17eaa2b..38eb3b50e0 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -345,7 +345,7 @@ static SDL_DeviceNotificationData s_notification_data; /* Function/thread to scan the system for joysticks. */ static int SDLCALL SDL_JoystickThread(void *_data) { -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT SDL_bool bOpenedXInputDevices[XUSER_MAX_COUNT]; SDL_zeroa(bOpenedXInputDevices); #endif @@ -363,7 +363,7 @@ static int SDLCALL SDL_JoystickThread(void *_data) #else { #endif -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT /* WM_DEVICECHANGE not working, poll for new XINPUT controllers */ SDL_CondWaitTimeout(s_condJoystickThread, s_mutexJoyStickEnum, 1000); if (SDL_XINPUT_Enabled() && XINPUTGETCAPABILITIES) { diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c index 24b47f02db..6831bd2574 100644 --- a/src/joystick/windows/SDL_xinputjoystick.c +++ b/src/joystick/windows/SDL_xinputjoystick.c @@ -22,7 +22,7 @@ #include "../SDL_sysjoystick.h" -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT #include "SDL_windowsjoystick_c.h" #include "SDL_xinputjoystick_c.h"