From d844487799e0103f7fb8484a7d044234a593f242 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 6 Jun 2017 12:35:35 -0400 Subject: [PATCH] windows: Fix compiling of XInput code on newer MinGW installs. Fixes Bugzilla #3609. --- src/core/windows/SDL_xinput.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/windows/SDL_xinput.h b/src/core/windows/SDL_xinput.h index 1f651d722..527bd35e9 100644 --- a/src/core/windows/SDL_xinput.h +++ b/src/core/windows/SDL_xinput.h @@ -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; @@ -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 {