SDL: build_configs: remove unused macros

From ddd7d0f927eaa9914c3dc70ba74bb28d39001062 Mon Sep 17 00:00:00 2001
From: L zard <[EMAIL REDACTED]>
Date: Sat, 2 Nov 2024 13:12:53 +0100
Subject: [PATCH] build_configs: remove unused macros

Those are only used in build_config files that define them themselves, or not used at all.
---
 include/build_config/SDL_build_config.h.cmake | 28 -------------------
 .../build_config/SDL_build_config_android.h   | 13 +++------
 include/build_config/SDL_build_config_ios.h   | 11 ++------
 include/build_config/SDL_build_config_macos.h | 11 ++------
 .../build_config/SDL_build_config_minimal.h   |  1 -
 .../build_config/SDL_build_config_windows.h   | 15 ++--------
 .../build_config/SDL_build_config_wingdk.h    | 13 ++-------
 include/build_config/SDL_build_config_xbox.h  | 15 ++--------
 8 files changed, 16 insertions(+), 91 deletions(-)

diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake
index 561836a998c7b..71e91d5025856 100644
--- a/include/build_config/SDL_build_config.h.cmake
+++ b/include/build_config/SDL_build_config.h.cmake
@@ -59,7 +59,6 @@
 #cmakedefine HAVE_MEMORY_H 1
 #cmakedefine HAVE_SIGNAL_H 1
 #cmakedefine HAVE_STDARG_H 1
-#cmakedefine HAVE_STDBOOL_H 1
 #cmakedefine HAVE_STDDEF_H 1
 #cmakedefine HAVE_STDINT_H 1
 #cmakedefine HAVE_STDIO_H 1
@@ -73,10 +72,7 @@
 /* C library functions */
 #cmakedefine HAVE_DLOPEN 1
 #cmakedefine HAVE_MALLOC 1
-#cmakedefine HAVE_CALLOC 1
-#cmakedefine HAVE_REALLOC 1
 #cmakedefine HAVE_FDATASYNC 1
-#cmakedefine HAVE_FREE 1
 #cmakedefine HAVE_GETENV 1
 #cmakedefine HAVE_GETHOSTNAME 1
 #cmakedefine HAVE_SETENV 1
@@ -92,8 +88,6 @@
 #cmakedefine HAVE_WCSNLEN 1
 #cmakedefine HAVE_WCSLCPY 1
 #cmakedefine HAVE_WCSLCAT 1
-#cmakedefine HAVE__WCSDUP 1
-#cmakedefine HAVE_WCSDUP 1
 #cmakedefine HAVE_WCSSTR 1
 #cmakedefine HAVE_WCSCMP 1
 #cmakedefine HAVE_WCSNCMP 1
@@ -104,8 +98,6 @@
 #cmakedefine HAVE_STRLCAT 1
 #cmakedefine HAVE_STRPBRK 1
 #cmakedefine HAVE__STRREV 1
-#cmakedefine HAVE__STRUPR 1
-#cmakedefine HAVE__STRLWR 1
 #cmakedefine HAVE_INDEX 1
 #cmakedefine HAVE_RINDEX 1
 #cmakedefine HAVE_STRCHR 1
@@ -128,8 +120,6 @@
 #cmakedefine HAVE_ATOF 1
 #cmakedefine HAVE_STRCMP 1
 #cmakedefine HAVE_STRNCMP 1
-#cmakedefine HAVE_STRCASESTR 1
-#cmakedefine HAVE_SSCANF 1
 #cmakedefine HAVE_VSSCANF 1
 #cmakedefine HAVE_VSNPRINTF 1
 #cmakedefine HAVE_ACOS 1
@@ -219,8 +209,6 @@
 #cmakedefine HAVE_DBUS_DBUS_H 1
 #cmakedefine HAVE_FCITX 1
 #cmakedefine HAVE_IBUS_IBUS_H 1
-#cmakedefine HAVE_SYS_INOTIFY_H 1
-#cmakedefine HAVE_INOTIFY_INIT 1
 #cmakedefine HAVE_INOTIFY_INIT1 1
 #cmakedefine HAVE_INOTIFY 1
 #cmakedefine HAVE_LIBUSB 1
@@ -231,7 +219,6 @@
 #cmakedefine HAVE_LIBDECOR_H 1
 #cmakedefine HAVE_LIBURING_H 1
 
-#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@
@@ -242,9 +229,7 @@
 #cmakedefine HAVE_DXGI1_6_H @HAVE_DXGI1_6_H@
 
 #cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
-#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
 #cmakedefine HAVE_TPCSHRD_H @HAVE_TPCSHRD_H@
-#cmakedefine HAVE_SENSORSAPI_H @HAVE_SENSORSAPI_H@
 #cmakedefine HAVE_ROAPI_H @HAVE_ROAPI_H@
 #cmakedefine HAVE_SHELLSCALINGAPI_H @HAVE_SHELLSCALINGAPI_H@
 
@@ -346,7 +331,6 @@
 /* Enable various shared object loading systems */
 #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
 #cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
-#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
 #cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
 
 /* Enable various threading systems */
@@ -371,7 +355,6 @@
 
 /* Enable various timer systems */
 #cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
-#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
 #cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
 #cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
 #cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@
@@ -444,13 +427,10 @@
 #cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
 #cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
 #cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
-#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
 #cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
 #cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
 #cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
 #cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
-#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
-#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
 
 /* Enable Vulkan support */
 #cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
@@ -492,7 +472,6 @@
 #cmakedefine SDL_FILESYSTEM_N3DS @SDL_FILESYSTEM_N3DS@
 
 /* Enable system storage support */
-#cmakedefine SDL_STORAGE_GENERIC @SDL_STORAGE_GENERIC@
 #cmakedefine SDL_STORAGE_STEAM @SDL_STORAGE_STEAM@
 
 /* Enable system FSops support */
@@ -515,12 +494,6 @@
 /* Enable dialog subsystem */
 #cmakedefine SDL_DIALOG_DUMMY @SDL_DIALOG_DUMMY@
 
-/* Enable misc subsystem */
-#cmakedefine SDL_MISC_DUMMY @SDL_MISC_DUMMY@
-
-/* Enable locale subsystem */
-#cmakedefine SDL_LOCALE_DUMMY @SDL_LOCALE_DUMMY@
-
 /* Enable assembly routines */
 #cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
 
@@ -560,7 +533,6 @@ typedef unsigned __int64 uintptr_t;
 #else
 typedef unsigned int uintptr_t;
 #endif
-#define _UINTPTR_T_DEFINED
 #endif
 #endif /* Visual Studio 2008 */
 #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
diff --git a/include/build_config/SDL_build_config_android.h b/include/build_config/SDL_build_config_android.h
index 34f26270e9012..50e0414fd74ae 100644
--- a/include/build_config/SDL_build_config_android.h
+++ b/include/build_config/SDL_build_config_android.h
@@ -41,8 +41,7 @@
 #define HAVE_LIMITS_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
+#define HAVE_STDARG_H    1
 #define HAVE_STDDEF_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_STDIO_H 1
@@ -54,11 +53,8 @@
 /* C library functions */
 #define HAVE_LIBC   1
 #define HAVE_DLOPEN 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FDATASYNC 1
-#define HAVE_FREE   1
+#define HAVE_MALLOC            1
+#define HAVE_FDATASYNC         1
 #define HAVE_GETENV 1
 #define HAVE_GETHOSTNAME 1
 #define HAVE_PUTENV 1
@@ -85,8 +81,7 @@
 #define HAVE_ATOI   1
 #define HAVE_ATOF 1
 #define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASESTR 1
+#define HAVE_STRNCMP           1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_ACOS   1
diff --git a/include/build_config/SDL_build_config_ios.h b/include/build_config/SDL_build_config_ios.h
index 1c58001820c06..7b81c01b25471 100644
--- a/include/build_config/SDL_build_config_ios.h
+++ b/include/build_config/SDL_build_config_ios.h
@@ -33,8 +33,7 @@
 #define HAVE_LIMITS_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
+#define HAVE_STDARG_H    1
 #define HAVE_STDDEF_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_STDIO_H 1
@@ -46,10 +45,7 @@
 /* C library functions */
 #define HAVE_LIBC   1
 #define HAVE_DLOPEN 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
+#define HAVE_MALLOC            1
 #define HAVE_GETENV 1
 #define HAVE_GETHOSTNAME 1
 #define HAVE_PUTENV 1
@@ -77,8 +73,7 @@
 #define HAVE_ATOF   1
 #define HAVE_STRCMP 1
 #define HAVE_STRNCMP    1
-#define HAVE_STRPBRK    1
-#define HAVE_STRCASESTR 1
+#define HAVE_STRPBRK           1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_ACOS   1
diff --git a/include/build_config/SDL_build_config_macos.h b/include/build_config/SDL_build_config_macos.h
index 08bbd81d8c532..6323355bac99b 100644
--- a/include/build_config/SDL_build_config_macos.h
+++ b/include/build_config/SDL_build_config_macos.h
@@ -38,8 +38,7 @@
 #define HAVE_LIMITS_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
+#define HAVE_STDARG_H    1
 #define HAVE_STDDEF_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_STDIO_H 1
@@ -51,10 +50,7 @@
 /* C library functions */
 #define HAVE_LIBC   1
 #define HAVE_DLOPEN 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
+#define HAVE_MALLOC            1
 #define HAVE_GETENV 1
 #define HAVE_GETHOSTNAME 1
 #define HAVE_SETENV 1
@@ -82,8 +78,7 @@
 #define HAVE_ATOI   1
 #define HAVE_ATOF   1
 #define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASESTR 1
+#define HAVE_STRNCMP           1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_ACOS   1
diff --git a/include/build_config/SDL_build_config_minimal.h b/include/build_config/SDL_build_config_minimal.h
index 962dee35189e9..d22567a95a46c 100644
--- a/include/build_config/SDL_build_config_minimal.h
+++ b/include/build_config/SDL_build_config_minimal.h
@@ -51,7 +51,6 @@ typedef unsigned __int64 uintptr_t;
 #else
 typedef unsigned int uintptr_t;
 #endif
-#define _UINTPTR_T_DEFINED
 #endif
 #else
 #define HAVE_STDINT_H 1
diff --git a/include/build_config/SDL_build_config_windows.h b/include/build_config/SDL_build_config_windows.h
index 24e21f88f60cd..9522c91d41fdb 100644
--- a/include/build_config/SDL_build_config_windows.h
+++ b/include/build_config/SDL_build_config_windows.h
@@ -69,7 +69,6 @@ typedef unsigned __int64 uintptr_t;
 #else
 typedef unsigned int uintptr_t;
 #endif
-#define _UINTPTR_T_DEFINED
 #endif
 #else
 #define HAVE_STDINT_H 1
@@ -124,7 +123,6 @@ typedef unsigned int uintptr_t;
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
 #define HAVE_STDDEF_H 1
 #define HAVE_STDIO_H 1
 #define HAVE_STDLIB_H 1
@@ -132,10 +130,7 @@ typedef unsigned int uintptr_t;
 #define HAVE_WCHAR_H 1
 
 /* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
+#define HAVE_MALLOC  1
 #define HAVE_ABS 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMCPY 1
@@ -143,9 +138,6 @@ typedef unsigned int uintptr_t;
 #define HAVE_MEMCMP 1
 #define HAVE_STRLEN 1
 #define HAVE__STRREV 1
-/* These functions have security warnings, so we won't use them */
-/* #undef HAVE__STRUPR */
-/* #undef HAVE__STRLWR */
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRSTR 1
@@ -160,9 +152,7 @@ typedef unsigned int uintptr_t;
 #define HAVE_ATOF 1
 #define HAVE_STRCMP 1
 #define HAVE_STRNCMP 1
-#define HAVE_STRPBRK 1
-#define HAVE__WCSDUP 1
-#define HAVE_SSCANF 1
+#define HAVE_STRPBRK           1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF 1
 #define HAVE_ACOS   1
@@ -232,7 +222,6 @@ typedef unsigned int uintptr_t;
 #define SDL_AUDIO_DRIVER_WASAPI 1
 #endif
 #define SDL_AUDIO_DRIVER_DSOUND 1
-#define SDL_AUDIO_DRIVER_WINMM  1
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
diff --git a/include/build_config/SDL_build_config_wingdk.h b/include/build_config/SDL_build_config_wingdk.h
index 5b7ebf1ddec75..ec055e1ec5869 100644
--- a/include/build_config/SDL_build_config_wingdk.h
+++ b/include/build_config/SDL_build_config_wingdk.h
@@ -63,7 +63,6 @@
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
 #define HAVE_STDDEF_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_STDIO_H 1
@@ -73,10 +72,7 @@
 
 /* C library functions */
 #define HAVE_LIBC   1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
+#define HAVE_MALLOC  1
 #define HAVE_ABS 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMCPY 1
@@ -84,9 +80,6 @@
 #define HAVE_MEMCMP 1
 #define HAVE_STRLEN 1
 #define HAVE__STRREV 1
-/* These functions have security warnings, so we won't use them */
-/* #undef HAVE__STRUPR */
-/* #undef HAVE__STRLWR */
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRSTR 1
@@ -100,8 +93,7 @@
 #define HAVE_ATOI 1
 #define HAVE_ATOF 1
 #define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE__WCSDUP 1
+#define HAVE_STRNCMP           1
 #define HAVE_ACOS   1
 #define HAVE_ASIN   1
 #define HAVE_ATAN   1
@@ -160,7 +152,6 @@
 #define SDL_AUDIO_DRIVER_WASAPI 1
 #endif
 #define SDL_AUDIO_DRIVER_DSOUND 1
-#define SDL_AUDIO_DRIVER_WINMM  1
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
diff --git a/include/build_config/SDL_build_config_xbox.h b/include/build_config/SDL_build_config_xbox.h
index 82b4f3c11a825..e2f0788ffe9cb 100644
--- a/include/build_config/SDL_build_config_xbox.h
+++ b/include/build_config/SDL_build_config_xbox.h
@@ -39,7 +39,6 @@
 /* #define HAVE_DXGI_H 1 */
 #define HAVE_XINPUT_H 1
 /*#define HAVE_WINDOWS_GAMING_INPUT_H 1*/
-/*#define HAVE_D3D11_H 1*/
 /*#define HAVE_ROAPI_H 1*/
 /*#define HAVE_SHELLSCALINGAPI_H 1*/
 #define HAVE_MMDEVICEAPI_H 1
@@ -62,7 +61,6 @@
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
 #define HAVE_STDDEF_H 1
 #define HAVE_STDINT_H 1
 #define HAVE_STDIO_H 1
@@ -72,10 +70,7 @@
 
 /* C library functions */
 #define HAVE_LIBC   1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
+#define HAVE_MALLOC  1
 #define HAVE_ABS 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMCPY 1
@@ -84,9 +79,6 @@
 #define HAVE_STRLEN 1
 #define HAVE_STRPBRK 1
 #define HAVE__STRREV 1
-/* These functions have security warnings, so we won't use them */
-/* #undef HAVE__STRUPR */
-/* #undef HAVE__STRLWR */
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRSTR 1
@@ -100,8 +92,7 @@
 #define HAVE_ATOI 1
 #define HAVE_ATOF 1
 #define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE__WCSDUP 1
+#define HAVE_STRNCMP           1
 #define HAVE_ACOS   1
 #define HAVE_ASIN   1
 #define HAVE_ATAN   1
@@ -160,7 +151,6 @@
 #define SDL_AUDIO_DRIVER_WASAPI 1
 #endif
 /*#define SDL_AUDIO_DRIVER_DSOUND 1*/
-/*#define SDL_AUDIO_DRIVER_WINMM  1*/
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
@@ -216,7 +206,6 @@
 
 /* Enable filesystem support */
 /* #define SDL_FILESYSTEM_WINDOWS 1*/
-#define SDL_FILESYSTEM_XBOX 1
 #define SDL_FSOPS_WINDOWS 1