WinRT: fixed build error in latest XInput code This change has also been tested as buildable + runnable on Win32 + MSVC 2015, 2013, 2012, and 2010. It may fix similar build errors (in XInput code) that are appearing in MingW builds (on buildbot).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
diff --git a/src/core/windows/SDL_xinput.h b/src/core/windows/SDL_xinput.h
index 664edd0..e649c55 100644
--- a/src/core/windows/SDL_xinput.h
+++ b/src/core/windows/SDL_xinput.h
@@ -118,11 +118,11 @@ typedef struct
XINPUT_GAMEPAD_EX Gamepad;
} XINPUT_STATE_EX;
-typedef struct _XINPUT_BATTERY_INFORMATION
+typedef struct
{
BYTE BatteryType;
BYTE BatteryLevel;
-} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
+} XINPUT_BATTERY_INFORMATION_EX;
/* Forward decl's for XInput API's we load dynamically and use if available */
typedef DWORD (WINAPI *XInputGetState_t)
@@ -146,9 +146,9 @@ typedef DWORD (WINAPI *XInputGetCapabilities_t)
typedef DWORD (WINAPI *XInputGetBatteryInformation_t)
(
- _In_ DWORD dwUserIndex,
- _In_ BYTE devType,
- _Out_ XINPUT_BATTERY_INFORMATION *pBatteryInformation
+ _In_ DWORD dwUserIndex,
+ _In_ BYTE devType,
+ _Out_ XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation
);
extern int WIN_LoadXInputDLL(void);
diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c
index b3a4c9e..cf71f5c 100644
--- a/src/joystick/windows/SDL_xinputjoystick.c
+++ b/src/joystick/windows/SDL_xinputjoystick.c
@@ -222,7 +222,7 @@ SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde
}
static void
-UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
+UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
{
if ( pBatteryInformation->BatteryType != BATTERY_TYPE_UNKNOWN )
{
@@ -253,7 +253,7 @@ UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_I
}
static void
-UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
+UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
{
static WORD s_XInputButtons[] = {
XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT,
@@ -280,7 +280,7 @@ UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputS
}
static void
-UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
+UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
{
static WORD s_XInputButtons[] = {
XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y,
@@ -325,7 +325,7 @@ SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick)
{
HRESULT result;
XINPUT_STATE_EX XInputState;
- XINPUT_BATTERY_INFORMATION XBatteryInformation;
+ XINPUT_BATTERY_INFORMATION_EX XBatteryInformation;
if (!XINPUTGETSTATE)
return;