windows: Fix compiling of XInput code on newer MinGW installs.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 06 Jun 2017 12:35:35 -0400
changeset 11068117d4ce1390e
parent 11067 f4d12a22446e
child 11069 abf45a095845
windows: Fix compiling of XInput code on newer MinGW installs.

Fixes Bugzilla #3609.
src/core/windows/SDL_xinput.h
     1.1 --- a/src/core/windows/SDL_xinput.h	Mon Jun 05 21:30:25 2017 -0400
     1.2 +++ b/src/core/windows/SDL_xinput.h	Tue Jun 06 12:35:35 2017 -0400
     1.3 @@ -100,6 +100,14 @@
     1.4  #endif
     1.5  
     1.6  /* typedef's for XInput structs we use */
     1.7 +
     1.8 +/* Don't redeclare these on MinGW with gcc >= 5.0.2 */
     1.9 +#if defined(__MINGW32__) && (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) >= 50002)
    1.10 +#define HAS_XINPUT_GAMEPAD_EX
    1.11 +#define HAS_XINPUT_STATE_EX
    1.12 +#endif
    1.13 +
    1.14 +#ifndef HAS_XINPUT_GAMEPAD_EX
    1.15  typedef struct
    1.16  {
    1.17      WORD wButtons;
    1.18 @@ -111,12 +119,15 @@
    1.19      SHORT sThumbRY;
    1.20      DWORD dwPaddingReserved;
    1.21  } XINPUT_GAMEPAD_EX;
    1.22 +#endif
    1.23  
    1.24 +#ifndef HAS_XINPUT_STATE_EX
    1.25  typedef struct
    1.26  {
    1.27      DWORD dwPacketNumber;
    1.28      XINPUT_GAMEPAD_EX Gamepad;
    1.29  } XINPUT_STATE_EX;
    1.30 +#endif
    1.31  
    1.32  typedef struct
    1.33  {