From 78026f549202ad4e31fe5bfb415412e62a13a43e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 8 Apr 2015 02:24:17 -0400 Subject: [PATCH] Patched to compile on Windows. --- src/joystick/windows/SDL_dinputjoystick.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index d5456c756..3fafdea8e 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -340,16 +340,16 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) { JoyStick_DeviceData *pNewJoystick; JoyStick_DeviceData *pPrevJoystick = NULL; + const DWORD devtype = (pdidInstance->dwDevType & 0xFF); + + if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD)) { + return DIENUM_CONTINUE; /* Ignore touchpads, etc. */ + } if (SDL_IsXInputDevice(&pdidInstance->guidProduct)) { return DIENUM_CONTINUE; /* ignore XInput devices here, keep going. */ } - const DWORD devtype = (pdidInstance->dwDevType & 0xFF); - if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD)) { - return DIENUM_CONTINUE; /* Ignore touchpads, etc. */ - } - pNewJoystick = *(JoyStick_DeviceData **)pContext; while (pNewJoystick) { if (!SDL_memcmp(&pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance))) {