Skip to content

Commit

Permalink
windows: Fix compiling of XInput code on newer MinGW installs.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #3609.
  • Loading branch information
icculus committed Jun 6, 2017
1 parent 599d9ba commit d844487
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/windows/SDL_xinput.h
Expand Up @@ -100,6 +100,14 @@
#endif

/* typedef's for XInput structs we use */

/* Don't redeclare these on MinGW with gcc >= 5.0.2 */
#if defined(__MINGW32__) && (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) >= 50002)
#define HAS_XINPUT_GAMEPAD_EX
#define HAS_XINPUT_STATE_EX
#endif

#ifndef HAS_XINPUT_GAMEPAD_EX
typedef struct
{
WORD wButtons;
Expand All @@ -111,12 +119,15 @@ typedef struct
SHORT sThumbRY;
DWORD dwPaddingReserved;
} XINPUT_GAMEPAD_EX;
#endif

#ifndef HAS_XINPUT_STATE_EX
typedef struct
{
DWORD dwPacketNumber;
XINPUT_GAMEPAD_EX Gamepad;
} XINPUT_STATE_EX;
#endif

typedef struct
{
Expand Down

0 comments on commit d844487

Please sign in to comment.