Fix -Wundef warnings due to use of unguarded SDL_JOYSTICK_XINPUT

This commit is contained in:
Anonymous Maarten
2023-03-27 15:30:35 +02:00
parent f0926bf02c
commit 89884075d5
4 changed files with 5 additions and 5 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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) {

View File

@@ -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"