Commit 28bf56c12cca64a239d54e890d0182b018b5ca9a

Sam Lantinga 2017-09-06T10:31:05

Fixed bug 3801 - HAVE_LIBSAMPLERATE_H depending on HAVE_LIBC in current SDL_config.h.in Ozkan Sezer HAVE_LIBSAMPLERATE_H is depending on HAVE_LIBC in current config.h.in: it shouldn't be. HAVE_LIBUDEV_H, HAVE_DBUS_DBUS_H, HAVE_IBUS_IBUS_H, HAVE_FCITX_FRONTEND_H, and HAVE_ALTIVEC_H have the same situation too. I suggest something like the following, which moves them out of the HAVE_LIBC confinement and also moves the windows dx header stuff along side them. (Not ideal, but a bit cleaner I think.)

diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 96641e7..915d512 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -47,17 +47,6 @@
 #cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
 #cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@
 
-#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
-#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@
-#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@
-#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@
-#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
-#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
 #if HAVE_LIBC
@@ -81,13 +70,7 @@
 #cmakedefine HAVE_FLOAT_H 1
 #cmakedefine HAVE_ICONV_H 1
 #cmakedefine HAVE_SIGNAL_H 1
-#cmakedefine HAVE_ALTIVEC_H 1
 #cmakedefine HAVE_PTHREAD_NP_H 1
-#cmakedefine HAVE_LIBUDEV_H 1
-#cmakedefine HAVE_DBUS_DBUS_H 1
-#cmakedefine HAVE_IBUS_IBUS_H 1
-#cmakedefine HAVE_FCITX_FRONTEND_H 1
-#cmakedefine HAVE_LIBSAMPLERATE_H 1
 
 /* C library functions */
 #cmakedefine HAVE_MALLOC 1
@@ -187,11 +170,30 @@
 #elif __WIN32__
 #cmakedefine HAVE_STDARG_H 1
 #cmakedefine HAVE_STDDEF_H 1
+#cmakedefine HAVE_FLOAT_H 1
 #else
 /* We may need some replacement for stdarg.h here */
 #include <stdarg.h>
 #endif /* HAVE_LIBC */
 
+#cmakedefine HAVE_ALTIVEC_H 1
+#cmakedefine HAVE_LIBUDEV_H 1
+#cmakedefine HAVE_DBUS_DBUS_H 1
+#cmakedefine HAVE_IBUS_IBUS_H 1
+#cmakedefine HAVE_FCITX_FRONTEND_H 1
+#cmakedefine HAVE_LIBSAMPLERATE_H 1
+
+#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
+#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@
+#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@
+#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@
+#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
+#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@
+
 /* SDL internal assertion support */
 #cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
 
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 57de49b..1139c0e 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -50,14 +50,6 @@
 #undef HAVE_GCC_ATOMICS
 #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET
 
-#undef HAVE_DDRAW_H
-#undef HAVE_DINPUT_H
-#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
 #if HAVE_LIBC
@@ -81,13 +73,7 @@
 #undef HAVE_FLOAT_H
 #undef HAVE_ICONV_H
 #undef HAVE_SIGNAL_H
-#undef HAVE_ALTIVEC_H
 #undef HAVE_PTHREAD_NP_H
-#undef HAVE_LIBUDEV_H
-#undef HAVE_DBUS_DBUS_H
-#undef HAVE_IBUS_IBUS_H
-#undef HAVE_FCITX_FRONTEND_H
-#undef HAVE_LIBSAMPLERATE_H
 
 /* C library functions */
 #undef HAVE_MALLOC
@@ -192,6 +178,21 @@
 #define HAVE_STDINT_H   1
 #endif /* HAVE_LIBC */
 
+#undef HAVE_ALTIVEC_H
+#undef HAVE_LIBUDEV_H
+#undef HAVE_DBUS_DBUS_H
+#undef HAVE_IBUS_IBUS_H
+#undef HAVE_FCITX_FRONTEND_H
+#undef HAVE_LIBSAMPLERATE_H
+
+#undef HAVE_DDRAW_H
+#undef HAVE_DINPUT_H
+#undef HAVE_DSOUND_H
+#undef HAVE_DXGI_H
+#undef HAVE_XINPUT_H
+#undef HAVE_XINPUT_GAMEPAD_EX
+#undef HAVE_XINPUT_STATE_EX
+
 /* SDL internal assertion support */
 #undef SDL_DEFAULT_ASSERT_LEVEL