SDL: Renamed SDL_HINT_DIRECTINPUT_ENABLED to SDL_HINT_JOYSTICK_DIRECTINPUT

From fd5d761128c951785379f7b313b386e773fc2638 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 11 Feb 2024 17:53:08 -0800
Subject: [PATCH] Renamed SDL_HINT_DIRECTINPUT_ENABLED to
 SDL_HINT_JOYSTICK_DIRECTINPUT

---
 build-scripts/SDL_migration.cocci         | 4 ++++
 docs/README-migration.md                  | 1 +
 include/SDL3/SDL_hints.h                  | 2 +-
 include/SDL3/SDL_oldnames.h               | 2 ++
 src/haptic/windows/SDL_dinputhaptic.c     | 2 +-
 src/joystick/windows/SDL_dinputjoystick.c | 2 +-
 6 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 8629b97ed189..265b1738583c 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -3012,3 +3012,7 @@ typedef SDL_version, SDL_Version;
 @@
 - SDL_HINT_ALLOW_TOPMOST
 + SDL_HINT_WINDOW_ALLOW_TOPMOST
+@@
+@@
+- SDL_HINT_DIRECTINPUT_ENABLED
++ SDL_HINT_JOYSTICK_DIRECTINPUT
diff --git a/docs/README-migration.md b/docs/README-migration.md
index 80a60ccbf377..a9f4f0b39e46 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -726,6 +726,7 @@ The following hints have been removed:
 
 The following hints have been renamed:
 * SDL_HINT_ALLOW_TOPMOST => SDL_HINT_WINDOW_ALLOW_TOPMOST
+* SDL_HINT_DIRECTINPUT_ENABLED => SDL_HINT_JOYSTICK_DIRECTINPUT
 
 ## SDL_init.h
 
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 0c024cd96c43..efbf75e1855c 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -364,7 +364,7 @@ extern "C" {
  *
  * This hint should be set before SDL is initialized.
  */
-#define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED"
+#define SDL_HINT_JOYSTICK_DIRECTINPUT "SDL_JOYSTICK_DIRECTINPUT"
 
 /**
  * Override for SDL_GetDisplayUsableBounds()
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index f19757c4c79b..a74573de022c 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -281,6 +281,7 @@
 
 /* ##SDL_hints.h */
 #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST
+#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT
 
 /* ##SDL_joystick.h */
 #define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMEPAD
@@ -756,6 +757,7 @@
 
 /* ##SDL_hints.h */
 #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST
+#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT
 
 /* ##SDL_joystick.h */
 #define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMECONTROLLER_renamed_SDL_JOYSTICK_TYPE_GAMEPAD
diff --git a/src/haptic/windows/SDL_dinputhaptic.c b/src/haptic/windows/SDL_dinputhaptic.c
index 700a8155eaee..bcae64c9ed7f 100644
--- a/src/haptic/windows/SDL_dinputhaptic.c
+++ b/src/haptic/windows/SDL_dinputhaptic.c
@@ -71,7 +71,7 @@ int SDL_DINPUT_HapticInit(void)
         return SDL_SetError("Haptic: SubSystem already open.");
     }
 
-    if (!SDL_GetHintBoolean(SDL_HINT_DIRECTINPUT_ENABLED, SDL_TRUE)) {
+    if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_DIRECTINPUT, SDL_TRUE)) {
         /* In some environments, IDirectInput8_Initialize / _EnumDevices can take a minute even with no controllers. */
         return 0;
     }
diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c
index 80a8d66eb310..150f59be22e6 100644
--- a/src/joystick/windows/SDL_dinputjoystick.c
+++ b/src/joystick/windows/SDL_dinputjoystick.c
@@ -398,7 +398,7 @@ int SDL_DINPUT_JoystickInit(void)
     HRESULT result;
     HINSTANCE instance;
 
-    if (!SDL_GetHintBoolean(SDL_HINT_DIRECTINPUT_ENABLED, SDL_TRUE)) {
+    if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_DIRECTINPUT, SDL_TRUE)) {
         /* In some environments, IDirectInput8_Initialize / _EnumDevices can take a minute even with no controllers. */
         dinput = NULL;
         return 0;