SDL: Removed SDL_ClearHints() from the public API

From 276566235c4b2079c16ff52ab55b66ee5ec3a9b9 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 24 Feb 2024 20:29:39 -0800
Subject: [PATCH] Removed SDL_ClearHints() from the public API

Fixes https://github.com/libsdl-org/SDL/issues/9129
---
 docs/README-migration.md          |  3 +++
 include/SDL3/SDL_hints.h          | 17 -----------------
 src/SDL.c                         |  1 +
 src/SDL_hints_c.h                 |  1 +
 src/dynapi/SDL_dynapi.sym         |  1 -
 src/dynapi/SDL_dynapi_overrides.h |  1 -
 src/dynapi/SDL_dynapi_procs.h     |  1 -
 7 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/docs/README-migration.md b/docs/README-migration.md
index 5f8555a31bd4c..f5b00db1015a2 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -740,6 +740,9 @@ The following hints have been renamed:
 * SDL_HINT_LINUX_JOYSTICK_DEADZONES => SDL_HINT_JOYSTICK_LINUX_DEADZONES
 * SDL_HINT_PS2_DYNAMIC_VSYNC => SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC
 
+The following functions have been removed:
+* SDL_ClearHints() - replaced with SDL_ResetHints()
+
 ## SDL_init.h
 
 The following symbols have been renamed:
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index dd43c3ed11730..80d4ff3cbc3b9 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -2661,23 +2661,6 @@ extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
                                                  SDL_HintCallback callback,
                                                  void *userdata);
 
-/**
- * Clear all hints.
- *
- * This function is automatically called during SDL_Quit(), and deletes all
- * callbacks without calling them and frees all memory associated with hints.
- * If you're calling this from application code you probably want to call
- * SDL_ResetHints() instead.
- *
- * This function will be removed from the API the next time we rev the ABI.
- *
- * \since This function is available since SDL 3.0.0.
- *
- * \sa SDL_ResetHints
- */
-extern DECLSPEC void SDLCALL SDL_ClearHints(void);
-
-
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }
diff --git a/src/SDL.c b/src/SDL.c
index 1553f80bcfbff..3653552a12463 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -37,6 +37,7 @@
 /* Initialization code for SDL */
 
 #include "SDL_assert_c.h"
+#include "SDL_hints_c.h"
 #include "SDL_log_c.h"
 #include "SDL_properties_c.h"
 #include "audio/SDL_sysaudio.h"
diff --git a/src/SDL_hints_c.h b/src/SDL_hints_c.h
index 68cceac7f36d5..486280ec6b2d8 100644
--- a/src/SDL_hints_c.h
+++ b/src/SDL_hints_c.h
@@ -27,5 +27,6 @@
 
 extern SDL_bool SDL_GetStringBoolean(const char *value, SDL_bool default_value);
 extern int SDL_GetStringInteger(const char *value, int default_value);
+extern void SDL_ClearHints(void);
 
 #endif /* SDL_hints_c_h_ */
diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym
index 93d0f32ebbc1a..e91067cfdc75a 100644
--- a/src/dynapi/SDL_dynapi.sym
+++ b/src/dynapi/SDL_dynapi.sym
@@ -37,7 +37,6 @@ SDL3_0.0.0 {
     SDL_CleanupTLS;
     SDL_ClearComposition;
     SDL_ClearError;
-    SDL_ClearHints;
     SDL_CloseGamepad;
     SDL_CloseJoystick;
     SDL_CloseSensor;
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index c116c68f6135f..e786e75aa0c8f 100644
--- a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -61,7 +61,6 @@
 #define SDL_CleanupTLS SDL_CleanupTLS_REAL
 #define SDL_ClearComposition SDL_ClearComposition_REAL
 #define SDL_ClearError SDL_ClearError_REAL
-#define SDL_ClearHints SDL_ClearHints_REAL
 #define SDL_CloseGamepad SDL_CloseGamepad_REAL
 #define SDL_CloseJoystick SDL_CloseJoystick_REAL
 #define SDL_CloseSensor SDL_CloseSensor_REAL
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index b98ba5e406942..98e2ffc2a3f0d 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -127,7 +127,6 @@ SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return)
 SDL_DYNAPI_PROC(void,SDL_CleanupTLS,(void),(),)
 SDL_DYNAPI_PROC(void,SDL_ClearComposition,(void),(),)
 SDL_DYNAPI_PROC(void,SDL_ClearError,(void),(),)
-SDL_DYNAPI_PROC(void,SDL_ClearHints,(void),(),)
 SDL_DYNAPI_PROC(void,SDL_CloseGamepad,(SDL_Gamepad *a),(a),)
 SDL_DYNAPI_PROC(void,SDL_CloseJoystick,(SDL_Joystick *a),(a),)
 SDL_DYNAPI_PROC(void,SDL_CloseSensor,(SDL_Sensor *a),(a),)