WinRT: fixed build error in latest XInput code
authorDavid Ludwig <dludwig@pobox.com>
Sat, 14 Nov 2015 21:29:14 -0500
changeset 991831b7adf67756
parent 9917 450a2f6e2bf2
child 9919 ac5490d5aefc
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).
src/core/windows/SDL_xinput.h
src/joystick/windows/SDL_xinputjoystick.c
     1.1 --- a/src/core/windows/SDL_xinput.h	Sat Nov 14 14:53:44 2015 -0500
     1.2 +++ b/src/core/windows/SDL_xinput.h	Sat Nov 14 21:29:14 2015 -0500
     1.3 @@ -118,11 +118,11 @@
     1.4      XINPUT_GAMEPAD_EX Gamepad;
     1.5  } XINPUT_STATE_EX;
     1.6  
     1.7 -typedef struct _XINPUT_BATTERY_INFORMATION
     1.8 +typedef struct
     1.9  {
    1.10      BYTE BatteryType;
    1.11      BYTE BatteryLevel;
    1.12 -} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
    1.13 +} XINPUT_BATTERY_INFORMATION_EX;
    1.14  
    1.15  /* Forward decl's for XInput API's we load dynamically and use if available */
    1.16  typedef DWORD (WINAPI *XInputGetState_t)
    1.17 @@ -146,9 +146,9 @@
    1.18  
    1.19  typedef DWORD (WINAPI *XInputGetBatteryInformation_t)
    1.20      (
    1.21 -    _In_  DWORD                      dwUserIndex,
    1.22 -    _In_  BYTE                       devType,
    1.23 -    _Out_ XINPUT_BATTERY_INFORMATION *pBatteryInformation
    1.24 +    _In_  DWORD                         dwUserIndex,
    1.25 +    _In_  BYTE                          devType,
    1.26 +    _Out_ XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation
    1.27      );
    1.28  
    1.29  extern int WIN_LoadXInputDLL(void);
     2.1 --- a/src/joystick/windows/SDL_xinputjoystick.c	Sat Nov 14 14:53:44 2015 -0500
     2.2 +++ b/src/joystick/windows/SDL_xinputjoystick.c	Sat Nov 14 21:29:14 2015 -0500
     2.3 @@ -222,7 +222,7 @@
     2.4  }
     2.5  
     2.6  static void 
     2.7 -UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
     2.8 +UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
     2.9  {
    2.10      if ( pBatteryInformation->BatteryType != BATTERY_TYPE_UNKNOWN )
    2.11      {
    2.12 @@ -253,7 +253,7 @@
    2.13  }
    2.14  
    2.15  static void
    2.16 -UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
    2.17 +UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
    2.18  {
    2.19      static WORD s_XInputButtons[] = {
    2.20          XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT,
    2.21 @@ -280,7 +280,7 @@
    2.22  }
    2.23  
    2.24  static void
    2.25 -UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION *pBatteryInformation)
    2.26 +UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation)
    2.27  {
    2.28      static WORD s_XInputButtons[] = {
    2.29          XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y,
    2.30 @@ -325,7 +325,7 @@
    2.31  {
    2.32      HRESULT result;
    2.33      XINPUT_STATE_EX XInputState;
    2.34 -    XINPUT_BATTERY_INFORMATION XBatteryInformation;
    2.35 +    XINPUT_BATTERY_INFORMATION_EX XBatteryInformation;
    2.36  
    2.37      if (!XINPUTGETSTATE)
    2.38          return;