autotools: added windows.gaming.input.h (and SDL_JOYSTICK_WGI) detection
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
diff --git a/configure b/configure
index 7699078..c87dc3d 100755
--- a/configure
+++ b/configure
@@ -24071,6 +24071,18 @@ $as_echo "#define HAVE_XINPUT_STATE_EX 1" >>confdefs.h
fi
fi
+ ac_fn_c_check_header_mongrel "$LINENO" "windows.gaming.input.h" "ac_cv_header_windows_gaming_input_h" "$ac_includes_default"
+if test "x$ac_cv_header_windows_gaming_input_h" = xyes; then :
+ have_wgi=yes
+fi
+
+
+ if test x$have_wgi = xyes; then
+
+$as_echo "#define HAVE_WINDOWS_GAMING_INPUT_H 1" >>confdefs.h
+
+ fi
+
ac_fn_c_check_header_mongrel "$LINENO" "mmdeviceapi.h" "ac_cv_header_mmdeviceapi_h" "$ac_includes_default"
if test "x$ac_cv_header_mmdeviceapi_h" = xyes; then :
have_wasapi=yes
@@ -25238,12 +25250,17 @@ $as_echo "#define SDL_AUDIO_DRIVER_WASAPI 1" >>confdefs.h
$as_echo "#define SDL_JOYSTICK_RAWINPUT 1" >>confdefs.h
- if test x$have_dinput = xyes -o x$have_xinput = xyes; then
+ if test x$have_dinput = xyes -o x$have_xinput = xyes -o x$have_wgi = xyes; then
if test x$have_xinput = xyes; then
$as_echo "#define SDL_JOYSTICK_XINPUT 1" >>confdefs.h
fi
+ if test x$have_wgi = xyes; then
+
+$as_echo "#define SDL_JOYSTICK_WGI 1" >>confdefs.h
+
+ fi
if test x$have_dinput = xyes; then
$as_echo "#define SDL_JOYSTICK_DINPUT 1" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index b61d3f1..bec63a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3199,6 +3199,11 @@ XINPUT_STATE_EX s1;
fi
fi
+ AC_CHECK_HEADER(windows.gaming.input.h, have_wgi=yes)
+ if test x$have_wgi = xyes; then
+ AC_DEFINE(HAVE_WINDOWS_GAMING_INPUT_H, 1, [ ])
+ fi
+
AC_CHECK_HEADER(mmdeviceapi.h, have_wasapi=yes)
if test x$have_wasapi = xyes; then
AC_DEFINE(HAVE_MMDEVICEAPI_H, 1, [ ])
@@ -3846,10 +3851,13 @@ case "$host" in
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_RAWINPUT, 1, [ ])
- if test x$have_dinput = xyes -o x$have_xinput = xyes; then
+ if test x$have_dinput = xyes -o x$have_xinput = xyes -o x$have_wgi = xyes; then
if test x$have_xinput = xyes; then
AC_DEFINE(SDL_JOYSTICK_XINPUT, 1, [ ])
fi
+ if test x$have_wgi = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_WGI, 1, [ ])
+ fi
if test x$have_dinput = xyes; then
AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ])
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8"
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 0bb904c..51731b4 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -232,6 +232,7 @@
#undef HAVE_DINPUT_H
#undef HAVE_DSOUND_H
#undef HAVE_DXGI_H
+#undef HAVE_WINDOWS_GAMING_INPUT_H
#undef HAVE_XINPUT_H
#undef HAVE_MMDEVICEAPI_H
@@ -307,6 +308,7 @@
#undef SDL_INPUT_WSCONS
#undef SDL_JOYSTICK_HAIKU
#undef SDL_JOYSTICK_DINPUT
+#undef SDL_JOYSTICK_WGI
#undef SDL_JOYSTICK_XINPUT
#undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT