diff -r 8a29b371e2db CMakeLists.txt --- a/CMakeLists.txt Tue Jun 06 14:06:40 2017 -0400 +++ b/CMakeLists.txt Thu Jun 08 08:55:00 2017 +0300 @@ -1092,6 +1092,16 @@ #include #include int main(int argc, char **argv) { }" HAVE_XINPUT_H) + check_c_source_compiles(" + #include + #include + XINPUT_GAMEPAD_EX x1; + int main(int argc, char **argv) { }" HAVE_XINPUT_GAMEPAD_EX) + check_c_source_compiles(" + #include + #include + XINPUT_STATE_EX s1; + int main(int argc, char **argv) { }" HAVE_XINPUT_STATE_EX) else() check_include_file(xinput.h HAVE_XINPUT_H) endif() diff -r 8a29b371e2db configure.in --- a/configure.in Tue Jun 06 14:06:40 2017 -0400 +++ b/configure.in Thu Jun 08 08:55:00 2017 +0300 @@ -2716,6 +2716,16 @@ AC_CHECK_HEADER(dxgi.h, have_dxgi=yes) AC_CHECK_HEADER(xaudio2.h, have_xaudio2=yes) AC_CHECK_HEADER(xinput.h, have_xinput=yes) + AC_TRY_COMPILE([ +#include +#include +XINPUT_GAMEPAD_EX x1; + ],[],[have_xinput_gamepadex=yes]) + AC_TRY_COMPILE([ +#include +#include +XINPUT_STATE_EX s1; + ],[],[have_xinput_stateex=yes]) if test x$have_ddraw = xyes; then AC_DEFINE(HAVE_DDRAW_H, 1, [ ]) @@ -2732,6 +2742,12 @@ if test x$have_xinput = xyes; then AC_DEFINE(HAVE_XINPUT_H, 1, [ ]) fi + if test x$have_xinput_gamepadex = xyes; then + AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ]) + fi + if test x$have_xinput_stateex = xyes; then + AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ]) + fi SUMMARY_video="${SUMMARY_video} directx" SUMMARY_audio="${SUMMARY_audio} directx" diff -r 8a29b371e2db configure --- a/configure Tue Jun 06 14:06:40 2017 -0400 +++ b/configure Thu Jun 08 08:55:00 2017 +0300 @@ -22540,6 +22540,44 @@ fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +XINPUT_GAMEPAD_EX x1; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_xinput_gamepadex=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +XINPUT_STATE_EX s1; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_xinput_stateex=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$have_ddraw = xyes; then @@ -22566,6 +22604,16 @@ $as_echo "#define HAVE_XINPUT_H 1" >>confdefs.h fi + if test x$have_xinput_gamepadex = xyes; then + +$as_echo "#define HAVE_XINPUT_GAMEPAD_EX 1" >>confdefs.h + + fi + if test x$have_xinput_stateex = xyes; then + +$as_echo "#define HAVE_XINPUT_STATE_EX 1" >>confdefs.h + + fi SUMMARY_video="${SUMMARY_video} directx" SUMMARY_audio="${SUMMARY_audio} directx" diff -r 8a29b371e2db include/SDL_config.h.cmake --- a/include/SDL_config.h.cmake Tue Jun 06 14:06:40 2017 -0400 +++ b/include/SDL_config.h.cmake Thu Jun 08 08:55:00 2017 +0300 @@ -55,6 +55,8 @@ #cmakedefine HAVE_XAUDIO2_H @HAVE_XAUDIO2_H@ #cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@ #cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@ +#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@ +#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@ /* Comment this if you want to build without any C library requirements */ #cmakedefine HAVE_LIBC 1 diff -r 8a29b371e2db include/SDL_config.h.in --- a/include/SDL_config.h.in Tue Jun 06 14:06:40 2017 -0400 +++ b/include/SDL_config.h.in Thu Jun 08 08:55:00 2017 +0300 @@ -55,6 +55,8 @@ #undef HAVE_DSOUND_H #undef HAVE_DXGI_H #undef HAVE_XINPUT_H +#undef HAVE_XINPUT_GAMEPAD_EX +#undef HAVE_XINPUT_STATE_EX /* Comment this if you want to build without any C library requirements */ #undef HAVE_LIBC diff -r 8a29b371e2db include/SDL_config_windows.h --- a/include/SDL_config_windows.h Tue Jun 06 14:06:40 2017 -0400 +++ b/include/SDL_config_windows.h Thu Jun 08 08:55:00 2017 +0300 @@ -82,6 +82,8 @@ #define HAVE_DSOUND_H 1 #define HAVE_DXGI_H 1 #define HAVE_XINPUT_H 1 +#define HAVE_XINPUT_GAMEPAD_EX 1 +#define HAVE_XINPUT_STATE_EX 1 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */ #ifdef HAVE_LIBC diff -r 8a29b371e2db src/core/windows/SDL_xinput.h --- a/src/core/windows/SDL_xinput.h Tue Jun 06 14:06:40 2017 -0400 +++ b/src/core/windows/SDL_xinput.h Thu Jun 08 08:55:00 2017 +0300 @@ -101,13 +101,7 @@ /* 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 +#ifndef HAVE_XINPUT_GAMEPAD_EX typedef struct { WORD wButtons; @@ -121,7 +115,7 @@ } XINPUT_GAMEPAD_EX; #endif -#ifndef HAS_XINPUT_STATE_EX +#ifndef HAVE_XINPUT_STATE_EX typedef struct { DWORD dwPacketNumber;