SDL: Removed SDL_bool in favor of plain bool

From a90ad3b0e28352401af32664b248eabad66a75a0 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 18 Sep 2024 07:52:28 -0700
Subject: [PATCH] Removed SDL_bool in favor of plain bool

We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
---
 VisualC-GDK/tests/testgdk/src/testgdk.cpp  |  10 +-
 build-scripts/SDL_migration.cocci          |  12 +
 docs/README-dynapi.md                      |   4 +-
 docs/README-ios.md                         |   4 +-
 docs/README-migration.md                   | 259 +++---
 docs/README-wayland.md                     |  10 +-
 examples/game/01-snake/snake.c             |   2 +-
 include/SDL3/SDL_assert.h                  |   2 +-
 include/SDL3/SDL_atomic.h                  |  20 +-
 include/SDL3/SDL_audio.h                   | 118 +--
 include/SDL3/SDL_bits.h                    |  12 +-
 include/SDL3/SDL_camera.h                  |   6 +-
 include/SDL3/SDL_clipboard.h               |  30 +-
 include/SDL3/SDL_cpuinfo.h                 |  56 +-
 include/SDL3/SDL_dialog.h                  |   4 +-
 include/SDL3/SDL_error.h                   |  14 +-
 include/SDL3/SDL_events.h                  |  70 +-
 include/SDL3/SDL_filesystem.h              |  24 +-
 include/SDL3/SDL_gamepad.h                 |  88 +-
 include/SDL3/SDL_gpu.h                     | 106 +--
 include/SDL3/SDL_haptic.h                  |  72 +-
 include/SDL3/SDL_hidapi.h                  |   4 +-
 include/SDL3/SDL_hints.h                   |  20 +-
 include/SDL3/SDL_init.h                    |  16 +-
 include/SDL3/SDL_iostream.h                | 134 +--
 include/SDL3/SDL_joystick.h                |  92 +--
 include/SDL3/SDL_keyboard.h                |  64 +-
 include/SDL3/SDL_log.h                     |   4 +-
 include/SDL3/SDL_main.h                    |   4 +-
 include/SDL3/SDL_messagebox.h              |   8 +-
 include/SDL3/SDL_misc.h                    |   4 +-
 include/SDL3/SDL_mouse.h                   |  40 +-
 include/SDL3/SDL_mutex.h                   |  38 +-
 include/SDL3/SDL_oldnames.h                |   6 +
 include/SDL3/SDL_pixels.h                  |   8 +-
 include/SDL3/SDL_process.h                 |  22 +-
 include/SDL3/SDL_properties.h              |  46 +-
 include/SDL3/SDL_rect.h                    |  88 +-
 include/SDL3/SDL_render.h                  | 272 +++---
 include/SDL3/SDL_sensor.h                  |   4 +-
 include/SDL3/SDL_stdinc.h                  |  76 +-
 include/SDL3/SDL_storage.h                 |  66 +-
 include/SDL3/SDL_surface.h                 | 182 ++---
 include/SDL3/SDL_system.h                  |  78 +-
 include/SDL3/SDL_test_common.h             |  20 +-
 include/SDL3/SDL_test_crc32.h              |  18 +-
 include/SDL3/SDL_test_font.h               |   8 +-
 include/SDL3/SDL_test_fuzzer.h             |  80 +-
 include/SDL3/SDL_thread.h                  |   8 +-
 include/SDL3/SDL_time.h                    |  16 +-
 include/SDL3/SDL_timer.h                   |   4 +-
 include/SDL3/SDL_video.h                   | 272 +++---
 include/SDL3/SDL_vulkan.h                  |  12 +-
 src/SDL.c                                  |  10 +-
 src/SDL_error.c                            |   6 +-
 src/SDL_hints.c                            |  10 +-
 src/SDL_internal.h                         |   6 +-
 src/SDL_log.c                              |   2 +-
 src/SDL_properties.c                       |  26 +-
 src/atomic/SDL_atomic.c                    |   6 +-
 src/atomic/SDL_spinlock.c                  |   2 +-
 src/audio/SDL_audio.c                      |  20 +-
 src/audio/SDL_audiocvt.c                   |  28 +-
 src/audio/SDL_mixer.c                      |   2 +-
 src/audio/SDL_wave.c                       |   4 +-
 src/audio/aaudio/SDL_aaudio.c              |   2 +-
 src/audio/openslES/SDL_openslES.c          |   2 +-
 src/camera/SDL_camera.c                    |   4 +-
 src/camera/SDL_camera_c.h                  |   2 +-
 src/camera/android/SDL_camera_android.c    |   2 +-
 src/core/SDL_core_unsupported.c            |  40 +-
 src/core/android/SDL_android.c             |  14 +-
 src/core/android/SDL_android.h             |   2 +-
 src/core/gdk/SDL_gdk.cpp                   |   4 +-
 src/core/linux/SDL_evdev.c                 |   2 +-
 src/core/linux/SDL_evdev.h                 |   2 +-
 src/core/linux/SDL_threadprio.c            |   4 +-
 src/cpuinfo/SDL_cpuinfo.c                  |  28 +-
 src/dialog/android/SDL_androiddialog.c     |   4 +-
 src/dialog/cocoa/SDL_cocoadialog.m         |   4 +-
 src/dialog/dummy/SDL_dummydialog.c         |   4 +-
 src/dialog/haiku/SDL_haikudialog.cc        |   4 +-
 src/dialog/unix/SDL_unixdialog.c           |   4 +-
 src/dialog/unix/SDL_zenitydialog.c         |  12 +-
 src/dialog/windows/SDL_windowsdialog.c     |   6 +-
 src/dynapi/SDL_dynapi.c                    |  18 +-
 src/dynapi/SDL_dynapi_procs.h              | 908 ++++++++++-----------
 src/events/SDL_events.c                    |  24 +-
 src/events/SDL_keyboard.c                  |   8 +-
 src/events/SDL_keymap.c                    |   2 +-
 src/events/SDL_mouse.c                     |  14 +-
 src/events/SDL_pen.c                       |   2 +-
 src/events/SDL_windowevents.c              |   2 +-
 src/file/SDL_iostream.c                    |  72 +-
 src/filesystem/SDL_filesystem.c            |  16 +-
 src/filesystem/SDL_sysfilesystem.h         |   4 +-
 src/gpu/SDL_gpu.c                          |  42 +-
 src/gpu/d3d11/SDL_gpu_d3d11.c              |   2 +-
 src/gpu/vulkan/SDL_gpu_vulkan.c            |   2 +-
 src/haptic/SDL_haptic.c                    |  32 +-
 src/hidapi/SDL_hidapi.c                    |   2 +-
 src/hidapi/android/hid.cpp                 |   2 +-
 src/joystick/SDL_gamepad.c                 |  46 +-
 src/joystick/SDL_joystick.c                |  42 +-
 src/joystick/virtual/SDL_virtualjoystick.c |   2 +-
 src/main/SDL_main_callbacks.c              |   2 +-
 src/misc/SDL_url.c                         |   2 +-
 src/process/SDL_process.c                  |   6 +-
 src/process/SDL_sysprocess.h               |   4 +-
 src/process/dummy/SDL_dummyprocess.c       |   4 +-
 src/process/posix/SDL_posixprocess.c       |   4 +-
 src/process/windows/SDL_windowsprocess.c   |   4 +-
 src/render/SDL_render.c                    | 132 +--
 src/render/gpu/SDL_pipeline_gpu.c          |   2 +-
 src/sensor/SDL_sensor.c                    |   2 +-
 src/stdlib/SDL_getenv.c                    |   8 +-
 src/stdlib/SDL_malloc.c                    |   2 +-
 src/storage/SDL_storage.c                  |  26 +-
 src/storage/generic/SDL_genericstorage.c   |  18 +-
 src/storage/steam/SDL_steamstorage.c       |  10 +-
 src/test/SDL_test_common.c                 |  74 +-
 src/test/SDL_test_crc32.c                  |  30 +-
 src/test/SDL_test_font.c                   |  34 +-
 src/test/SDL_test_fuzzer.c                 |  24 +-
 src/test/SDL_test_harness.c                |  14 +-
 src/test/SDL_test_memory.c                 |  14 +-
 src/thread/SDL_thread.c                    |  10 +-
 src/thread/generic/SDL_syscond.c           |   2 +-
 src/thread/generic/SDL_sysmutex.c          |   2 +-
 src/thread/generic/SDL_sysrwlock.c         |   4 +-
 src/thread/generic/SDL_syssem.c            |   4 +-
 src/thread/n3ds/SDL_syscond.c              |   2 +-
 src/thread/n3ds/SDL_sysmutex.c             |   2 +-
 src/thread/n3ds/SDL_syssem.c               |   2 +-
 src/thread/ngage/SDL_sysmutex.cpp          |   2 +-
 src/thread/ps2/SDL_syssem.c                |   2 +-
 src/thread/psp/SDL_sysmutex.c              |   2 +-
 src/thread/psp/SDL_syssem.c                |   2 +-
 src/thread/pthread/SDL_syscond.c           |   2 +-
 src/thread/pthread/SDL_sysmutex.c          |   2 +-
 src/thread/pthread/SDL_sysrwlock.c         |   4 +-
 src/thread/pthread/SDL_syssem.c            |   2 +-
 src/thread/vita/SDL_sysmutex.c             |   2 +-
 src/thread/vita/SDL_syssem.c               |   2 +-
 src/thread/windows/SDL_syscond_cv.c        |   2 +-
 src/thread/windows/SDL_sysmutex.c          |   2 +-
 src/thread/windows/SDL_sysrwlock_srw.c     |   4 +-
 src/thread/windows/SDL_syssem.c            |   2 +-
 src/time/SDL_time.c                        |   4 +-
 src/time/n3ds/SDL_systime.c                |   4 +-
 src/time/ps2/SDL_systime.c                 |   4 +-
 src/time/psp/SDL_systime.c                 |   4 +-
 src/time/unix/SDL_systime.c                |   4 +-
 src/time/vita/SDL_systime.c                |   4 +-
 src/time/windows/SDL_systime.c             |   4 +-
 src/timer/SDL_timer.c                      |   4 +-
 src/video/SDL_bmp.c                        |   6 +-
 src/video/SDL_clipboard.c                  |  14 +-
 src/video/SDL_fillrect.c                   |   4 +-
 src/video/SDL_pixels.c                     |   4 +-
 src/video/SDL_rect_impl.h                  |  10 +-
 src/video/SDL_surface.c                    |  72 +-
 src/video/SDL_video.c                      | 156 ++--
 src/video/SDL_video_unsupported.c          |  14 +-
 src/video/cocoa/SDL_cocoametalview.m       |   2 +-
 src/video/cocoa/SDL_cocoawindow.m          |   2 +-
 src/video/psp/SDL_pspevents.c              |   2 +-
 src/video/uikit/SDL_uikitevents.m          |   2 +-
 src/video/uikit/SDL_uikitwindow.m          |   2 +-
 src/video/wayland/SDL_waylandwindow.c      |   6 +-
 src/video/windows/SDL_windowsevents.c      |   6 +-
 src/video/windows/SDL_windowsgameinput.c   |   2 +-
 src/video/windows/SDL_windowsvideo.c       |   2 +-
 src/video/x11/SDL_x11events.c              |   2 +-
 test/checkkeys.c                           |  10 +-
 test/childprocess.c                        |  18 +-
 test/gamepadutils.c                        | 196 ++---
 test/gamepadutils.h                        |  22 +-
 test/relative_mode.markdown                |   2 +-
 test/testatomic.c                          |  58 +-
 test/testaudio.c                           |  32 +-
 test/testaudiohotplug.c                    |   2 +-
 test/testaudioinfo.c                       |   6 +-
 test/testaudiostreamdynamicresample.c      |  14 +-
 test/testautomation_audio.c                |  28 +-
 test/testautomation_clipboard.c            | 104 +--
 test/testautomation_events.c               |   4 +-
 test/testautomation_hints.c                |   6 +-
 test/testautomation_intrinsics.c           |  94 +--
 test/testautomation_iostream.c             |  54 +-
 test/testautomation_joystick.c             |  32 +-
 test/testautomation_keyboard.c             |  12 +-
 test/testautomation_main.c                 |   6 +-
 test/testautomation_math.c                 |  16 +-
 test/testautomation_mouse.c                |  42 +-
 test/testautomation_platform.c             |  18 +-
 test/testautomation_properties.c           |  62 +-
 test/testautomation_rect.c                 | 344 ++++----
 test/testautomation_render.c               |  74 +-
 test/testautomation_sdltest.c              | 528 ++++++------
 test/testautomation_stdlib.c               |  84 +-
 test/testautomation_surface.c              |  76 +-
 test/testautomation_time.c                 |  28 +-
 test/testautomation_timer.c                |   6 +-
 test/testautomation_video.c                | 234 +++---
 test/testcamera.c                          |   6 +-
 test/testcolorspace.c                      |  10 +-
 test/testcontroller.c                      | 230 +++---
 test/testcustomcursor.c                    |   4 +-
 test/testdisplayinfo.c                     |   2 +-
 test/testdraw.c                            |   8 +-
 test/testdropfile.c                        |   6 +-
 test/testerror.c                           |   4 +-
 test/testffmpeg.c                          | 144 ++--
 test/testffmpeg_vulkan.c                   |   4 +-
 test/testgeometry.c                        |   6 +-
 test/testgl.c                              |  10 +-
 test/testgles2.c                           |   4 +-
 test/testgpu_simple_clear.c                |   2 +-
 test/testgpu_spinning_cube.c               |  24 +-
 test/testhotplug.c                         |  10 +-
 test/testime.c                             |  32 +-
 test/testintersections.c                   |   8 +-
 test/testlocale.c                          |   2 +-
 test/testmanymouse.c                       |  12 +-
 test/testmouse.c                           |  20 +-
 test/testnative.c                          |   4 +-
 test/testoffscreen.c                       |   4 +-
 test/testoverlay.c                         |   6 +-
 test/testpen.c                             |   8 +-
 test/testplatform.c                        |  14 +-
 test/testpopup.c                           |  16 +-
 test/testprocess.c                         |  42 +-
 test/testrelative.c                        |   6 +-
 test/testrendercopyex.c                    |   4 +-
 test/testrendertarget.c                    |  24 +-
 test/testrwlock.c                          |   2 +-
 test/testscale.c                           |   4 +-
 test/testsem.c                             |  16 +-
 test/testsensor.c                          |   4 +-
 test/testshader.c                          |  34 +-
 test/testshape.c                           |  12 +-
 test/testsprite.c                          |  18 +-
 test/testspriteminimal.c                   |   4 +-
 test/testspritesurface.c                   |   4 +-
 test/teststreaming.c                       |   6 +-
 test/testsurround.c                        |   4 +-
 test/testtime.c                            |   4 +-
 test/testtimer.c                           |   4 +-
 test/testutils.c                           |  14 +-
 test/testutils.h                           |   2 +-
 test/testviewport.c                        |   6 +-
 test/testvulkan.c                          |  38 +-
 test/testwaylandcustom.c                   |  10 +-
 test/testwm.c                              |   6 +-
 test/testyuv.c                             |  52 +-
 test/testyuv_cvt.c                         |  16 +-
 test/testyuv_cvt.h                         |   2 +-
 258 files changed, 4054 insertions(+), 4059 deletions(-)

diff --git a/VisualC-GDK/tests/testgdk/src/testgdk.cpp b/VisualC-GDK/tests/testgdk/src/testgdk.cpp
index 46301b2ca2509..b3aa9ec8b37da 100644
--- a/VisualC-GDK/tests/testgdk/src/testgdk.cpp
+++ b/VisualC-GDK/tests/testgdk/src/testgdk.cpp
@@ -35,8 +35,8 @@ extern "C" {
 static SDLTest_CommonState *state;
 static int num_sprites;
 static SDL_Texture **sprites;
-static SDL_bool cycle_color;
-static SDL_bool cycle_alpha;
+static bool cycle_color;
+static bool cycle_alpha;
 static int cycle_direction = 1;
 static int current_alpha = 0;
 static int current_color = 0;
@@ -193,7 +193,7 @@ LoadSprite(const char *file)
 
     for (i = 0; i < state->num_windows; ++i) {
         /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
-        sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h);
+        sprites[i] = LoadTexture(state->renderers[i], file, true, &sprite_w, &sprite_h);
         if (!sprites[i]) {
             return -1;
         }
@@ -371,10 +371,10 @@ main(int argc, char *argv[])
                     }
                 }
             } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
-                cycle_color = SDL_TRUE;
+                cycle_color = true;
                 consumed = 1;
             } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) {
-                cycle_alpha = SDL_TRUE;
+                cycle_alpha = true;
                 consumed = 1;
             } else if (SDL_isdigit(*argv[i])) {
                 num_sprites = SDL_atoi(argv[i]);
diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 41d178c8ae896..0483a40bb2ff2 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -3687,3 +3687,15 @@ identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAltern
 - SDL_GetCPUCount
 + SDL_GetNumLogicalCPUCores
   (...)
+@@
+@@
+- SDL_bool
++ bool
+@@
+@@
+- SDL_TRUE
++ true
+@@
+@@
+- SDL_FALSE
++ false
diff --git a/docs/README-dynapi.md b/docs/README-dynapi.md
index 60a29498291c7..9c137dbfb691b 100644
--- a/docs/README-dynapi.md
+++ b/docs/README-dynapi.md
@@ -35,7 +35,7 @@ SDL now has, internally, a table of function pointers. So, this is what SDL_Init
 now looks like:
 
 ```c
-SDL_bool SDL_Init(SDL_InitFlags flags)
+bool SDL_Init(SDL_InitFlags flags)
 {
     return jump_table.SDL_Init(flags);
 }
@@ -49,7 +49,7 @@ SDL_Init() that you've been calling all this time. But at startup, it looks more
 like this:
 
 ```c
-SDL_bool SDL_Init_DEFAULT(SDL_InitFlags flags)
+bool SDL_Init_DEFAULT(SDL_InitFlags flags)
 {
     SDL_InitDynamicAPI();
     return jump_table.SDL_Init(flags);
diff --git a/docs/README-ios.md b/docs/README-ios.md
index cce35b58c4a9a..06e2375aa40f6 100644
--- a/docs/README-ios.md
+++ b/docs/README-ios.md
@@ -139,7 +139,7 @@ void SDL_StartTextInput()
 void SDL_StopTextInput()
 	-- disables text events and hides the onscreen keyboard.
 
-SDL_bool SDL_TextInputActive()
+bool SDL_TextInputActive()
 	-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
 
 
@@ -225,7 +225,7 @@ Game Center
 
 Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
 
-    SDL_bool SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
+    bool SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
 
 This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
 
diff --git a/docs/README-migration.md b/docs/README-migration.md
index 43aa25eaabc05..7e402ba3f99a3 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -6,7 +6,7 @@ Details on API changes are organized by SDL 2.0 header below.
 
 The file with your main() function should include <SDL3/SDL_main.h>, as that is no longer included in SDL.h.
 
-Functions that previously returned a negative error code now return SDL_bool.
+Functions that previously returned a negative error code now return bool.
 
 Code that used to look like this:
 ```c
@@ -226,7 +226,7 @@ SDL_FreeWAV has been removed and calls can be replaced with SDL_free.
 
 SDL_LoadWAV() is a proper function now and no longer a macro (but offers the same functionality otherwise).
 
-SDL_LoadWAV_IO() and SDL_LoadWAV() return an SDL_bool now, like most of SDL. They no longer return a pointer to an SDL_AudioSpec.
+SDL_LoadWAV_IO() and SDL_LoadWAV() return an bool now, like most of SDL. They no longer return a pointer to an SDL_AudioSpec.
 
 SDL_AudioCVT interface has been removed, the SDL_AudioStream interface (for audio supplied in pieces) or the new SDL_ConvertAudioSamples() function (for converting a complete audio buffer in one call) can be used instead.
 
@@ -283,13 +283,13 @@ In SDL2, SDL_AUDIODEVICEREMOVED events would fire for open devices with the `whi
 
 The following functions have been renamed:
 * SDL_AudioStreamAvailable() => SDL_GetAudioStreamAvailable()
-* SDL_AudioStreamClear() => SDL_ClearAudioStream(), returns SDL_bool
-* SDL_AudioStreamFlush() => SDL_FlushAudioStream(), returns SDL_bool
+* SDL_AudioStreamClear() => SDL_ClearAudioStream(), returns bool
+* SDL_AudioStreamFlush() => SDL_FlushAudioStream(), returns bool
 * SDL_AudioStreamGet() => SDL_GetAudioStreamData()
-* SDL_AudioStreamPut() => SDL_PutAudioStreamData(), returns SDL_bool
+* SDL_AudioStreamPut() => SDL_PutAudioStreamData(), returns bool
 * SDL_FreeAudioStream() => SDL_DestroyAudioStream()
-* SDL_LoadWAV_RW() => SDL_LoadWAV_IO(), returns SDL_bool
-* SDL_MixAudioFormat() => SDL_MixAudio(), returns SDL_bool
+* SDL_LoadWAV_RW() => SDL_LoadWAV_IO(), returns bool
+* SDL_MixAudioFormat() => SDL_MixAudio(), returns bool
 * SDL_NewAudioStream() => SDL_CreateAudioStream()
 
 
@@ -364,7 +364,7 @@ The following functions have been removed:
 
 ## SDL_events.h
 
-SDL_PRESSED and SDL_RELEASED have been removed. For the most part you can replace uses of these with SDL_TRUE and SDL_FALSE respectively. Events which had a field `state` to represent these values have had those fields changed to SDL_bool `down`, e.g. `event.key.state` is now `event.key.down`.
+SDL_PRESSED and SDL_RELEASED have been removed. For the most part you can replace uses of these with true and false respectively. Events which had a field `state` to represent these values have had those fields changed to bool `down`, e.g. `event.key.state` is now `event.key.down`.
 
 The timestamp member of the SDL_Event structure now represents nanoseconds, and is populated with SDL_GetTicksNS()
 
@@ -417,7 +417,7 @@ SDL_AddEventWatch() now returns SDL_FALSE_ if it fails because it ran out of mem
 
 SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events.
 
-SDL_EventFilter functions now return SDL_bool.
+SDL_EventFilter functions now return bool.
 
 The following symbols have been renamed:
 * SDL_APP_DIDENTERBACKGROUND => SDL_EVENT_DID_ENTER_BACKGROUND
@@ -511,15 +511,15 @@ The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West
 #define CONFIRM_BUTTON SDL_GAMEPAD_BUTTON_SOUTH
 #define CANCEL_BUTTON SDL_GAMEPAD_BUTTON_EAST
 
-SDL_bool flipped_buttons;
+bool flipped_buttons;
 
 void InitMappedButtons(SDL_Gamepad *gamepad)
 {
     if (!GetFlippedButtonSetting(&flipped_buttons)) {
         if (SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B) {
-            flipped_buttons = SDL_TRUE;
+            flipped_buttons = true;
         } else {
-            flipped_buttons = SDL_FALSE;
+            flipped_buttons = false;
         }
     }
 }
@@ -577,7 +577,7 @@ SDL_CONTROLLER_TYPE_VIRTUAL has been removed, so virtual controllers can emulate
 
 SDL_CONTROLLER_TYPE_AMAZON_LUNA has been removed, and can be replaced with this code:
 ```c
-SDL_bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id)
+bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id)
 {
     return ((vendor_id == 0x1949 && product_id == 0x0419) ||
             (vendor_id == 0x0171 && product_id == 0x0419));
@@ -586,7 +586,7 @@ SDL_bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id)
 
 SDL_CONTROLLER_TYPE_GOOGLE_STADIA has been removed, and can be replaced with this code:
 ```c
-SDL_bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_id)
+bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_id)
 {
     return (vendor_id == 0x18d1 && product_id == 0x9400);
 }
@@ -594,7 +594,7 @@ SDL_bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_i
 
 SDL_CONTROLLER_TYPE_NVIDIA_SHIELD has been removed, and can be replaced with this code:
 ```c
-SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_id)
+bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_id)
 {
     return (vendor_id == 0x0955 && (product_id == 0x7210 || product_id == 0x7214));
 }
@@ -602,7 +602,7 @@ SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_i
 
 The inputType and outputType fields of SDL_GamepadBinding have been renamed input_type and output_type.
 
-SDL_GetGamepadTouchpadFinger() takes a pointer to SDL_bool for the finger state instead of a pointer to Uint8.
+SDL_GetGamepadTouchpadFinger() takes a pointer to bool for the finger state instead of a pointer to Uint8.
 
 The following enums have been renamed:
 * SDL_GameControllerAxis => SDL_GamepadAxis
@@ -634,13 +634,13 @@ The following functions have been renamed:
 * SDL_GameControllerGetPlayerIndex() => SDL_GetGamepadPlayerIndex()
 * SDL_GameControllerGetProduct() => SDL_GetGamepadProduct()
 * SDL_GameControllerGetProductVersion() => SDL_GetGamepadProductVersion()
-* SDL_GameControllerGetSensorData() => SDL_GetGamepadSensorData(), returns SDL_bool
+* SDL_GameControllerGetSensorData() => SDL_GetGamepadSensorData(), returns bool
 * SDL_GameControllerGetSensorDataRate() => SDL_GetGamepadSensorDataRate()
 * SDL_GameControllerGetSerial() => SDL_GetGamepadSerial()
 * SDL_GameControllerGetSteamHandle() => SDL_GetGamepadSteamHandle()
 * SDL_GameControllerGetStringForAxis() => SDL_GetGamepadStringForAxis()
 * SDL_GameControllerGetStringForButton() => SDL_GetGamepadStringForButton()
-* SDL_GameControllerGetTouchpadFinger() => SDL_GetGamepadTouchpadFinger(), returns SDL_bool
+* SDL_GameControllerGetTouchpadFinger() => SDL_GetGamepadTouchpadFinger(), returns bool
 * SDL_GameControllerGetType() => SDL_GetGamepadType()
 * SDL_GameControllerGetVendor() => SDL_GetGamepadVendor()
 * SDL_GameControllerHasAxis() => SDL_GamepadHasAxis()
@@ -652,12 +652,12 @@ The following functions have been renamed:
 * SDL_GameControllerName() => SDL_GetGamepadName()
 * SDL_GameControllerOpen() => SDL_OpenGamepad()
 * SDL_GameControllerPath() => SDL_GetGamepadPath()
-* SDL_GameControllerRumble() => SDL_RumbleGamepad(), returns SDL_bool
-* SDL_GameControllerRumbleTriggers() => SDL_RumbleGamepadTriggers(), returns SDL_bool
-* SDL_GameControllerSendEffect() => SDL_SendGamepadEffect(), returns SDL_bool
-* SDL_GameControllerSetLED() => SDL_SetGamepadLED(), returns SDL_bool
-* SDL_GameControllerSetPlayerIndex() => SDL_SetGamepadPlayerIndex(), returns SDL_bool
-* SDL_GameControllerSetSensorEnabled() => SDL_SetGamepadSensorEnabled(), returns SDL_bool
+* SDL_GameControllerRumble() => SDL_RumbleGamepad(), returns bool
+* SDL_GameControllerRumbleTriggers() => SDL_RumbleGamepadTriggers(), returns bool
+* SDL_GameControllerSendEffect() => SDL_SendGamepadEffect(), returns bool
+* SDL_GameControllerSetLED() => SDL_SetGamepadLED(), returns bool
+* SDL_GameControllerSetPlayerIndex() => SDL_SetGamepadPlayerIndex(), returns bool
+* SDL_GameControllerSetSensorEnabled() => SDL_SetGamepadSensorEnabled(), returns bool
 * SDL_GameControllerUpdate() => SDL_UpdateGamepads()
 * SDL_IsGameController() => SDL_IsGamepad()
 
@@ -760,12 +760,12 @@ Rather than iterating over haptic devices using device index, there is a new fun
 }

-SDL_GetHapticEffectStatus() now returns SDL_bool instead of an int result. You should call SDL_GetHapticFeatures() to make sure effect status is supported before calling this function.
+SDL_GetHapticEffectStatus() now returns bool instead of an int result. You should call SDL_GetHapticFeatures() to make sure effect status is supported before calling this function.

The following functions have been renamed:

  • SDL_HapticClose() => SDL_CloseHaptic()
  • SDL_HapticDestroyEffect() => SDL_DestroyHapticEffect()
    -* SDL_HapticGetEffectStatus() => SDL_GetHapticEffectStatus(), returns SDL_bool
    +* SDL_HapticGetEffectStatus() => SDL_GetHapticEffectStatus(), returns bool
  • SDL_HapticNewEffect() => SDL_CreateHapticEffect()
  • SDL_HapticNumAxes() => SDL_GetNumHapticAxes()
  • SDL_HapticNumEffects() => SDL_GetMaxHapticEffects()
    @@ -773,18 +773,18 @@ The following functions have been renamed:
  • SDL_HapticOpen() => SDL_OpenHaptic()
  • SDL_HapticOpenFromJoystick() => SDL_OpenHapticFromJoystick()
  • SDL_HapticOpenFromMouse() => SDL_OpenHapticFromMouse()
    -* SDL_HapticPause() => SDL_PauseHaptic(), returns SDL_bool
    +* SDL_HapticPause() => SDL_PauseHaptic(), returns bool
  • SDL_HapticQuery() => SDL_GetHapticFeatures()
    -* SDL_HapticRumbleInit() => SDL_InitHapticRumble(), returns SDL_bool
    -* SDL_HapticRumblePlay() => SDL_PlayHapticRumble(), returns SDL_bool
    -* SDL_HapticRumbleStop() => SDL_StopHapticRumble(), returns SDL_bool
    -* SDL_HapticRunEffect() => SDL_RunHapticEffect(), returns SDL_bool
    -* SDL_HapticSetAutocenter() => SDL_SetHapticAutocenter(), returns SDL_bool
    -* SDL_HapticSetGain() => SDL_SetHapticGain(), returns SDL_bool
    -* SDL_HapticStopAll() => SDL_StopHapticEffects(), returns SDL_bool
    -* SDL_HapticStopEffect() => SDL_StopHapticEffect(), returns SDL_bool
    -* SDL_HapticUnpause() => SDL_ResumeHaptic(), returns SDL_bool
    -* SDL_HapticUpdateEffect() => SDL_UpdateHapticEffect(), returns SDL_bool
    +* SDL_HapticRumbleInit() => SDL_InitHapticRumble(), returns bool
    +* SDL_HapticRumblePlay() => SDL_PlayHapticRumble(), returns bool
    +* SDL_HapticRumbleStop() => SDL_StopHapticRumble(), returns bool
    +* SDL_HapticRunEffect() => SDL_RunHapticEffect(), returns bool
    +* SDL_HapticSetAutocenter() => SDL_SetHapticAutocenter(), returns bool
    +* SDL_HapticSetGain() => SDL_SetHapticGain(), returns bool
    +* SDL_HapticStopAll() => SDL_StopHapticEffects(), returns bool
    +* SDL_HapticStopEffect() => SDL_StopHapticEffect(), returns bool
    +* SDL_HapticUnpause() => SDL_ResumeHaptic(), returns bool
    +* SDL_HapticUpdateEffect() => SDL_UpdateHapticEffect(), returns bool
  • SDL_JoystickIsHaptic() => SDL_IsJoystickHaptic()
  • SDL_MouseIsHaptic() => SDL_IsMouseHaptic()

@@ -843,7 +843,7 @@ The following hints have been removed:

  • SDL_HINT_VIDEO_X11_XVIDMODE - Xvidmode no longer supported by the X11 backend
  • SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING - SDL now properly handles the 0x406D1388 Exception if no debugger intercepts it, preventing its propagation.
  • SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS - Slim Reader/Writer Locks are always used if available
    -* SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to SDL_TRUE
    +* SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to true
  • SDL_HINT_WINRT_HANDLE_BACK_BUTTON - WinRT support was removed in SDL3.
  • SDL_HINT_WINRT_PRIVACY_POLICY_LABEL - WinRT support was removed in SDL3.
  • SDL_HINT_WINRT_PRIVACY_POLICY_URL - WinRT support was removed in SDL3.
    @@ -937,13 +937,13 @@ SDL_VirtualJoystickDesc version should not be set to SDL_VIRTUAL_JOYSTICK_DESC_V
    The following functions have been renamed:
  • SDL_JoystickAttachVirtualEx() => SDL_AttachVirtualJoystick()
  • SDL_JoystickClose() => SDL_CloseJoystick()
    -* SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick(), returns SDL_bool
    +* SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick(), returns bool
  • SDL_JoystickFromInstanceID() => SDL_GetJoystickFromID()
  • SDL_JoystickFromPlayerIndex() => SDL_GetJoystickFromPlayerIndex()
  • SDL_JoystickGetAttached() => SDL_JoystickConnected()
  • SDL_JoystickGetAxis() => SDL_GetJoystickAxis()
  • SDL_JoystickGetAxisInitialState() => SDL_GetJoystickAxisInitialState()
    -* SDL_JoystickGetBall() => SDL_GetJoystickBall(), returns SDL_bool
    +* SDL_JoystickGetBall() => SDL_GetJoystickBall(), returns bool
  • SDL_JoystickGetButton() => SDL_GetJoystickButton()
  • SDL_JoystickGetFirmwareVersion() => SDL_GetJoystickFirmwareVersion()
  • SDL_JoystickGetGUID() => SDL_GetJoystickGUID()
    @@ -964,14 +964,14 @@ The following functions have been renamed:
  • SDL_JoystickNumHats() => SDL_GetNumJoystickHats()
  • SDL_JoystickOpen() => SDL_OpenJoystick()
  • SDL_JoystickPath() => SDL_GetJoystickPath()
    -* SDL_JoystickRumble() => SDL_RumbleJoystick(), returns SDL_bool
    -* SDL_JoystickRumbleTriggers() => SDL_RumbleJoystickTriggers(), returns SDL_bool
    -* SDL_JoystickSendEffect() => SDL_SendJoystickEffect(), returns SDL_bool
    -* SDL_JoystickSetLED() => SDL_SetJoystickLED(), returns SDL_bool
    -* SDL_JoystickSetPlayerIndex() => SDL_SetJoystickPlayerIndex(), returns SDL_bool
    -* SDL_JoystickSetVirtualAxis() => SDL_SetJoystickVirtualAxis(), returns SDL_bool
    -* SDL_JoystickSetVirtualButton() => SDL_SetJo
(Patch may be truncated, please check the link at the top of this post.)