From 9c9c3c82622c0c9ef01dd25a1df4eb969a839abf Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 15 Sep 2024 07:22:11 -0700
Subject: [PATCH] Updated for latest SDL changes as of
97d40b9218038edaf7afe61d6114fb48d8f26a82
---
src/sdl2_compat.c | 15 ++--
src/sdl3_include_wrapper.h | 137 ++++++++++++++++++++++++++++++++++---
src/sdl3_syms.h | 7 +-
3 files changed, 139 insertions(+), 20 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index e73db12..ffb1a56 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -530,15 +530,15 @@ SDL2Compat_ApplyQuirks(SDL_bool force_x11)
/* if you change this, update also SDL2_to_SDL3_hint() */
for (i = 0; i < SDL_arraysize(renamed_hints); ++i) {
- old_env = SDL3_getenv(renamed_hints[i].old_hint);
+ old_env = SDL3_GetEnvironmentVariable(SDL3_GetEnvironment(), renamed_hints[i].old_hint);
if (old_env) {
- SDL3_setenv(renamed_hints[i].new_hint, old_env, 1);
+ SDL3_SetEnvironmentVariable(SDL3_GetEnvironment(), renamed_hints[i].new_hint, old_env, SDL_TRUE);
}
}
#ifdef __linux__
if (force_x11) {
- const char *videodriver_env = SDL3_getenv("SDL_VIDEODRIVER");
+ const char *videodriver_env = SDL3_GetEnvironmentVariable(SDL3_GetEnvironment(), "SDL_VIDEODRIVER");
if (videodriver_env && (SDL3_strcmp(videodriver_env, "x11") != 0)) {
if (WantDebugLogging) {
SDL3_Log("This app looks like it requires X11, but the SDL_VIDEODRIVER environment variable is set to \"%s\". If you have issues, try setting SDL_VIDEODRIVER=x11", videodriver_env);
@@ -547,7 +547,7 @@ SDL2Compat_ApplyQuirks(SDL_bool force_x11)
if (WantDebugLogging) {
SDL3_Log("sdl2-compat: We are forcing this app to use X11, because it probably talks to an X server directly, outside of SDL. If possible, this app should be fixed, to be compatible with Wayland, etc.");
}
- SDL3_setenv("SDL_VIDEO_DRIVER", "x11", 1);
+ SDL3_SetEnvironmentVariable(SDL3_GetEnvironment(), "SDL_VIDEO_DRIVER", "x11", SDL_TRUE);
}
}
#endif
@@ -557,15 +557,16 @@ SDL2Compat_ApplyQuirks(SDL_bool force_x11)
}
for (i = 0; i < SDL_arraysize(quirks); i++) {
if (!SDL3_strcmp(exe_name, quirks[i].exe_name)) {
- if (!SDL3_getenv(quirks[i].hint_name)) {
+ const char *var = SDL3_GetEnvironmentVariable(SDL3_GetEnvironment(), quirks[i].hint_name);
+ if (!var) {
if (WantDebugLogging) {
SDL3_Log("Applying compatibility quirk %s=\"%s\" for \"%s\"", quirks[i].hint_name, quirks[i].hint_value, exe_name);
}
- SDL3_setenv(quirks[i].hint_name, quirks[i].hint_value, 1);
+ SDL3_SetEnvironmentVariable(SDL3_GetEnvironment(), quirks[i].hint_name, quirks[i].hint_value, SDL_TRUE);
} else {
if (WantDebugLogging) {
SDL3_Log("Not applying compatibility quirk %s=\"%s\" for \"%s\" due to environment variable override (\"%s\")\n",
- quirks[i].hint_name, quirks[i].hint_value, exe_name, SDL3_getenv(quirks[i].hint_name));
+ quirks[i].hint_name, quirks[i].hint_value, exe_name, var);
}
}
}
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index 590a231..e477327 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -116,6 +116,7 @@
#define SDL_CreateCondition IGNORE_THIS_VERSION_OF_SDL_CreateCondition
#define SDL_CreateCursor IGNORE_THIS_VERSION_OF_SDL_CreateCursor
#define SDL_CreateDirectory IGNORE_THIS_VERSION_OF_SDL_CreateDirectory
+#define SDL_CreateEnvironment IGNORE_THIS_VERSION_OF_SDL_CreateEnvironment
#define SDL_CreateGPUBuffer IGNORE_THIS_VERSION_OF_SDL_CreateGPUBuffer
#define SDL_CreateGPUComputePipeline IGNORE_THIS_VERSION_OF_SDL_CreateGPUComputePipeline
#define SDL_CreateGPUDevice IGNORE_THIS_VERSION_OF_SDL_CreateGPUDevice
@@ -129,6 +130,8 @@
#define SDL_CreateMutex IGNORE_THIS_VERSION_OF_SDL_CreateMutex
#define SDL_CreatePalette IGNORE_THIS_VERSION_OF_SDL_CreatePalette
#define SDL_CreatePopupWindow IGNORE_THIS_VERSION_OF_SDL_CreatePopupWindow
+#define SDL_CreateProcess IGNORE_THIS_VERSION_OF_SDL_CreateProcess
+#define SDL_CreateProcessWithProperties IGNORE_THIS_VERSION_OF_SDL_CreateProcessWithProperties
#define SDL_CreateProperties IGNORE_THIS_VERSION_OF_SDL_CreateProperties
#define SDL_CreateRWLock IGNORE_THIS_VERSION_OF_SDL_CreateRWLock
#define SDL_CreateRenderer IGNORE_THIS_VERSION_OF_SDL_CreateRenderer
@@ -155,10 +158,12 @@
#define SDL_DestroyAudioStream IGNORE_THIS_VERSION_OF_SDL_DestroyAudioStream
#define SDL_DestroyCondition IGNORE_THIS_VERSION_OF_SDL_DestroyCondition
#define SDL_DestroyCursor IGNORE_THIS_VERSION_OF_SDL_DestroyCursor
+#define SDL_DestroyEnvironment IGNORE_THIS_VERSION_OF_SDL_DestroyEnvironment
#define SDL_DestroyGPUDevice IGNORE_THIS_VERSION_OF_SDL_DestroyGPUDevice
#define SDL_DestroyHapticEffect IGNORE_THIS_VERSION_OF_SDL_DestroyHapticEffect
#define SDL_DestroyMutex IGNORE_THIS_VERSION_OF_SDL_DestroyMutex
#define SDL_DestroyPalette IGNORE_THIS_VERSION_OF_SDL_DestroyPalette
+#define SDL_DestroyProcess IGNORE_THIS_VERSION_OF_SDL_DestroyProcess
#define SDL_DestroyProperties IGNORE_THIS_VERSION_OF_SDL_DestroyProperties
#define SDL_DestroyRWLock IGNORE_THIS_VERSION_OF_SDL_DestroyRWLock
#define SDL_DestroyRenderer IGNORE_THIS_VERSION_OF_SDL_DestroyRenderer
@@ -201,6 +206,7 @@
#define SDL_FlushAudioStream IGNORE_THIS_VERSION_OF_SDL_FlushAudioStream
#define SDL_FlushEvent IGNORE_THIS_VERSION_OF_SDL_FlushEvent
#define SDL_FlushEvents IGNORE_THIS_VERSION_OF_SDL_FlushEvents
+#define SDL_FlushIO IGNORE_THIS_VERSION_OF_SDL_FlushIO
#define SDL_FlushRenderer IGNORE_THIS_VERSION_OF_SDL_FlushRenderer
#define SDL_GDKResumeGPU IGNORE_THIS_VERSION_OF_SDL_GDKResumeGPU
#define SDL_GDKSuspendComplete IGNORE_THIS_VERSION_OF_SDL_GDKSuspendComplete
@@ -220,6 +226,8 @@
#define SDL_GL_SetSwapInterval IGNORE_THIS_VERSION_OF_SDL_GL_SetSwapInterval
#define SDL_GL_SwapWindow IGNORE_THIS_VERSION_OF_SDL_GL_SwapWindow
#define SDL_GL_UnloadLibrary IGNORE_THIS_VERSION_OF_SDL_GL_UnloadLibrary
+#define SDL_GPUSupportsProperties IGNORE_THIS_VERSION_OF_SDL_GPUSupportsProperties
+#define SDL_GPUSupportsShaderFormats IGNORE_THIS_VERSION_OF_SDL_GPUSupportsShaderFormats
#define SDL_GPUTextureFormatTexelBlockSize IGNORE_THIS_VERSION_OF_SDL_GPUTextureFormatTexelBlockSize
#define SDL_GPUTextureSupportsFormat IGNORE_THIS_VERSION_OF_SDL_GPUTextureSupportsFormat
#define SDL_GPUTextureSupportsSampleCount IGNORE_THIS_VERSION_OF_SDL_GPUTextureSupportsSampleCount
@@ -262,7 +270,6 @@
#define SDL_GetBasePath IGNORE_THIS_VERSION_OF_SDL_GetBasePath
#define SDL_GetBooleanProperty IGNORE_THIS_VERSION_OF_SDL_GetBooleanProperty
#define SDL_GetCPUCacheLineSize IGNORE_THIS_VERSION_OF_SDL_GetCPUCacheLineSize
-#define SDL_GetCPUCount IGNORE_THIS_VERSION_OF_SDL_GetCPUCount
#define SDL_GetCameraDriver IGNORE_THIS_VERSION_OF_SDL_GetCameraDriver
#define SDL_GetCameraFormat IGNORE_THIS_VERSION_OF_SDL_GetCameraFormat
#define SDL_GetCameraID IGNORE_THIS_VERSION_OF_SDL_GetCameraID
@@ -302,13 +309,18 @@
#define SDL_GetDisplayProperties IGNORE_THIS_VERSION_OF_SDL_GetDisplayProperties
#define SDL_GetDisplayUsableBounds IGNORE_THIS_VERSION_OF_SDL_GetDisplayUsableBounds
#define SDL_GetDisplays IGNORE_THIS_VERSION_OF_SDL_GetDisplays
+#define SDL_GetEnvironment IGNORE_THIS_VERSION_OF_SDL_GetEnvironment
+#define SDL_GetEnvironmentVariable IGNORE_THIS_VERSION_OF_SDL_GetEnvironmentVariable
+#define SDL_GetEnvironmentVariables IGNORE_THIS_VERSION_OF_SDL_GetEnvironmentVariables
#define SDL_GetError IGNORE_THIS_VERSION_OF_SDL_GetError
#define SDL_GetEventFilter IGNORE_THIS_VERSION_OF_SDL_GetEventFilter
#define SDL_GetFloatProperty IGNORE_THIS_VERSION_OF_SDL_GetFloatProperty
#define SDL_GetFullscreenDisplayModes IGNORE_THIS_VERSION_OF_SDL_GetFullscreenDisplayModes
#define SDL_GetGDKDefaultUser IGNORE_THIS_VERSION_OF_SDL_GetGDKDefaultUser
#define SDL_GetGDKTaskQueue IGNORE_THIS_VERSION_OF_SDL_GetGDKTaskQueue
+#define SDL_GetGPUDeviceDriver IGNORE_THIS_VERSION_OF_SDL_GetGPUDeviceDriver
#define SDL_GetGPUDriver IGNORE_THIS_VERSION_OF_SDL_GetGPUDriver
+#define SDL_GetGPUShaderFormats IGNORE_THIS_VERSION_OF_SDL_GetGPUShaderFormats
#define SDL_GetGPUSwapchainTextureFormat IGNORE_THIS_VERSION_OF_SDL_GetGPUSwapchainTextureFormat
#define SDL_GetGamepadAppleSFSymbolsNameForAxis IGNORE_THIS_VERSION_OF_SDL_GetGamepadAppleSFSymbolsNameForAxis
#define SDL_GetGamepadAppleSFSymbolsNameForButton IGNORE_THIS_VERSION_OF_SDL_GetGamepadAppleSFSymbolsNameForButton
@@ -424,6 +436,7 @@
#define SDL_GetNumAllocations IGNORE_THIS_VERSION_OF_SDL_GetNumAllocations
#define SDL_GetNumAudioDrivers IGNORE_THIS_VERSION_OF_SDL_GetNumAudioDrivers
#define SDL_GetNumCameraDrivers IGNORE_THIS_VERSION_OF_SDL_GetNumCameraDrivers
+#define SDL_GetNumGPUDrivers IGNORE_THIS_VERSION_OF_SDL_GetNumGPUDrivers
#define SDL_GetNumGamepadTouchpadFingers IGNORE_THIS_VERSION_OF_SDL_GetNumGamepadTouchpadFingers
#define SDL_GetNumGamepadTouchpads IGNORE_THIS_VERSION_OF_SDL_GetNumGamepadTouchpads
#define SDL_GetNumHapticAxes IGNORE_THIS_VERSION_OF_SDL_GetNumHapticAxes
@@ -431,6 +444,7 @@
#define SDL_GetNumJoystickBalls IGNORE_THIS_VERSION_OF_SDL_GetNumJoystickBalls
#define SDL_GetNumJoystickButtons IGNORE_THIS_VERSION_OF_SDL_GetNumJoystickButtons
#define SDL_GetNumJoystickHats IGNORE_THIS_VERSION_OF_SDL_GetNumJoystickHats
+#define SDL_GetNumLogicalCPUCores IGNORE_THIS_VERSION_OF_SDL_GetNumLogicalCPUCores
#define SDL_GetNumRenderDrivers IGNORE_THIS_VERSION_OF_SDL_GetNumRenderDrivers
#define SDL_GetNumVideoDrivers IGNORE_THIS_VERSION_OF_SDL_GetNumVideoDrivers
#define SDL_GetNumberProperty IGNORE_THIS_VERSION_OF_SDL_GetNumberProperty
@@ -448,6 +462,9 @@
#define SDL_GetPreferredLocales IGNORE_THIS_VERSION_OF_SDL_GetPreferredLocales
#define SDL_GetPrimaryDisplay IGNORE_THIS_VERSION_OF_SDL_GetPrimaryDisplay
#define SDL_GetPrimarySelectionText IGNORE_THIS_VERSION_OF_SDL_GetPrimarySelectionText
+#define SDL_GetProcessInput IGNORE_THIS_VERSION_OF_SDL_GetProcessInput
+#define SDL_GetProcessOutput IGNORE_THIS_VERSION_OF_SDL_GetProcessOutput
+#define SDL_GetProcessProperties IGNORE_THIS_VERSION_OF_SDL_GetProcessProperties
#define SDL_GetPropertyType IGNORE_THIS_VERSION_OF_SDL_GetPropertyType
#define SDL_GetRGB IGNORE_THIS_VERSION_OF_SDL_GetRGB
#define SDL_GetRGBA IGNORE_THIS_VERSION_OF_SDL_GetRGBA
@@ -618,6 +635,7 @@
#define SDL_IsTablet IGNORE_THIS_VERSION_OF_SDL_IsTablet
#define SDL_JoystickConnected IGNORE_THIS_VERSION_OF_SDL_JoystickConnected
#define SDL_JoystickEventsEnabled IGNORE_THIS_VERSION_OF_SDL_JoystickEventsEnabled
+#define SDL_KillProcess IGNORE_THIS_VERSION_OF_SDL_KillProcess
#define SDL_LoadBMP IGNORE_THIS_VERSION_OF_SDL_LoadBMP
#define SDL_LoadBMP_IO IGNORE_THIS_VERSION_OF_SDL_LoadBMP_IO
#define SDL_LoadFile IGNORE_THIS_VERSION_OF_SDL_LoadFile
@@ -702,6 +720,7 @@
#define SDL_QuitSubSystem IGNORE_THIS_VERSION_OF_SDL_QuitSubSystem
#define SDL_RaiseWindow IGNORE_THIS_VERSION_OF_SDL_RaiseWindow
#define SDL_ReadIO IGNORE_THIS_VERSION_OF_SDL_ReadIO
+#define SDL_ReadProcess IGNORE_THIS_VERSION_OF_SDL_ReadProcess
#define SDL_ReadS16BE IGNORE_THIS_VERSION_OF_SDL_ReadS16BE
#define SDL_ReadS16LE IGNORE_THIS_VERSION_OF_SDL_ReadS16LE
#define SDL_ReadS32BE IGNORE_THIS_VERSION_OF_SDL_ReadS32BE
@@ -805,6 +824,7 @@
#define SDL_SetClipboardData IGNORE_THIS_VERSION_OF_SDL_SetClipboardData
#define SDL_SetClipboardText IGNORE_THIS_VERSION_OF_SDL_SetClipboardText
#define SDL_SetCursor IGNORE_THIS_VERSION_OF_SDL_SetCursor
+#define SDL_SetEnvironmentVariable IGNORE_THIS_VERSION_OF_SDL_SetEnvironmentVariable
#define SDL_SetError IGNORE_THIS_VERSION_OF_SDL_SetError
#define SDL_SetEventEnabled IGNORE_THIS_VERSION_OF_SDL_SetEventEnabled
#define SDL_SetEventFilter IGNORE_THIS_VERSION_OF_SDL_SetEventFilter
@@ -953,6 +973,7 @@
#define SDL_UnlockTexture IGNORE_THIS_VERSION_OF_SDL_UnlockTexture
#define SDL_UnmapGPUTransferBuffer IGNORE_THIS_VERSION_OF_SDL_UnmapGPUTransferBuffer
#define SDL_UnregisterApp IGNORE_THIS_VERSION_OF_SDL_UnregisterApp
+#define SDL_UnsetEnvironmentVariable IGNORE_THIS_VERSION_OF_SDL_UnsetEnvironmentVariable
#define SDL_UpdateGamepads IGNORE_THIS_VERSION_OF_SDL_UpdateGamepads
#define SDL_UpdateHapticEffect IGNORE_THIS_VERSION_OF_SDL_UpdateHapticEffect
#define SDL_UpdateJoysticks IGNORE_THIS_VERSION_OF_SDL_UpdateJoysticks
@@ -977,6 +998,7 @@
#define SDL_WaitEventTimeout IGNORE_THIS_VERSION_OF_SDL_WaitEventTimeout
#define SDL_WaitForGPUFences IGNORE_THIS_VERSION_OF_SDL_WaitForGPUFences
#define SDL_WaitForGPUIdle IGNORE_THIS_VERSION_OF_SDL_WaitForGPUIdle
+#define SDL_WaitProcess IGNORE_THIS_VERSION_OF_SDL_WaitProcess
#define SDL_WaitSemaphore IGNORE_THIS_VERSION_OF_SDL_WaitSemaphore
#define SDL_WaitSemaphoreTimeout IGNORE_THIS_VERSION_OF_SDL_WaitSemaphoreTimeout
#define SDL_WaitThread IGNORE_THIS_VERSION_OF_SDL_WaitThread
@@ -1039,6 +1061,7 @@
#define SDL_fmodf IGNORE_THIS_VERSION_OF_SDL_fmodf
#define SDL_free IGNORE_THIS_VERSION_OF_SDL_free
#define SDL_getenv IGNORE_THIS_VERSION_OF_SDL_getenv
+#define SDL_getenv_unsafe IGNORE_THIS_VERSION_OF_SDL_getenv_unsafe
#define SDL_hid_ble_scan IGNORE_THIS_VERSION_OF_SDL_hid_ble_scan
#define SDL_hid_close IGNORE_THIS_VERSION_OF_SDL_hid_close
#define SDL_hid_device_change_count IGNORE_THIS_VERSION_OF_SDL_hid_device_change_count
@@ -1113,7 +1136,7 @@
#define SDL_roundf IGNORE_THIS_VERSION_OF_SDL_roundf
#define SDL_scalbn IGNORE_THIS_VERSION_OF_SDL_scalbn
#define SDL_scalbnf IGNORE_THIS_VERSION_OF_SDL_scalbnf
-#define SDL_setenv IGNORE_THIS_VERSION_OF_SDL_setenv
+#define SDL_setenv_unsafe IGNORE_THIS_VERSION_OF_SDL_setenv_unsafe
#define SDL_sin IGNORE_THIS_VERSION_OF_SDL_sin
#define SDL_sinf IGNORE_THIS_VERSION_OF_SDL_sinf
#define SDL_snprintf IGNORE_THIS_VERSION_OF_SDL_snprintf
@@ -1156,7 +1179,7 @@
#define SDL_uitoa IGNORE_THIS_VERSION_OF_SDL_uitoa
#define SDL_ulltoa IGNORE_THIS_VERSION_OF_SDL_ulltoa
#define SDL_ultoa IGNORE_THIS_VERSION_OF_SDL_ultoa
-#define SDL_unsetenv IGNORE_THIS_VERSION_OF_SDL_unsetenv
+#define SDL_unsetenv_unsafe IGNORE_THIS_VERSION_OF_SDL_unsetenv_unsafe
#define SDL_utf8strlcpy IGNORE_THIS_VERSION_OF_SDL_utf8strlcpy
#define SDL_utf8strlen IGNORE_THIS_VERSION_OF_SDL_utf8strlen
#define SDL_utf8strnlen IGNORE_THIS_VERSION_OF_SDL_utf8strnlen
@@ -1532,6 +1555,10 @@
#undef SDL_CreateDirectory
#endif
+#ifdef SDL_CreateEnvironment
+#undef SDL_CreateEnvironment
+#endif
+
#ifdef SDL_CreateGPUBuffer
#undef SDL_CreateGPUBuffer
#endif
@@ -1584,6 +1611,14 @@
#undef SDL_CreatePopupWindow
#endif
+#ifdef SDL_CreateProcess
+#undef SDL_CreateProcess
+#endif
+
+#ifdef SDL_CreateProcessWithProperties
+#undef SDL_CreateProcessWithProperties
+#endif
+
#ifdef SDL_CreateProperties
#undef SDL_CreateProperties
#endif
@@ -1688,6 +1723,10 @@
#undef SDL_DestroyCursor
#endif
+#ifdef SDL_DestroyEnvironment
+#undef SDL_DestroyEnvironment
+#endif
+
#ifdef SDL_DestroyGPUDevice
#undef SDL_DestroyGPUDevice
#endif
@@ -1704,6 +1743,10 @@
#undef SDL_DestroyPalette
#endif
+#ifdef SDL_DestroyProcess
+#undef SDL_DestroyProcess
+#endif
+
#ifdef SDL_DestroyProperties
#undef SDL_DestroyProperties
#endif
@@ -1872,6 +1915,10 @@
#undef SDL_FlushEvents
#endif
+#ifdef SDL_FlushIO
+#undef SDL_FlushIO
+#endif
+
#ifdef SDL_FlushRenderer
#undef SDL_FlushRenderer
#endif
@@ -1948,6 +1995,14 @@
#undef SDL_GL_UnloadLibrary
#endif
+#ifdef SDL_GPUSupportsProperties
+#undef SDL_GPUSupportsProperties
+#endif
+
+#ifdef SDL_GPUSupportsShaderFormats
+#undef SDL_GPUSupportsShaderFormats
+#endif
+
#ifdef SDL_GPUTextureFormatTexelBlockSize
#undef SDL_GPUTextureFormatTexelBlockSize
#endif
@@ -2116,10 +2171,6 @@
#undef SDL_GetCPUCacheLineSize
#endif
-#ifdef SDL_GetCPUCount
-#undef SDL_GetCPUCount
-#endif
-
#ifdef SDL_GetCameraDriver
#undef SDL_GetCameraDriver
#endif
@@ -2276,6 +2327,18 @@
#undef SDL_GetDisplays
#endif
+#ifdef SDL_GetEnvironment
+#undef SDL_GetEnvironment
+#endif
+
+#ifdef SDL_GetEnvironmentVariable
+#undef SDL_GetEnvironmentVariable
+#endif
+
+#ifdef SDL_GetEnvironmentVariables
+#undef SDL_GetEnvironmentVariables
+#endif
+
#ifdef SDL_GetError
#undef SDL_GetError
#endif
@@ -2300,10 +2363,18 @@
#undef SDL_GetGDKTaskQueue
#endif
+#ifdef SDL_GetGPUDeviceDriver
+#undef SDL_GetGPUDeviceDriver
+#endif
+
#ifdef SDL_GetGPUDriver
#undef SDL_GetGPUDriver
#endif
+#ifdef SDL_GetGPUShaderFormats
+#undef SDL_GetGPUShaderFormats
+#endif
+
#ifdef SDL_GetGPUSwapchainTextureFormat
#undef SDL_GetGPUSwapchainTextureFormat
#endif
@@ -2764,6 +2835,10 @@
#undef SDL_GetNumCameraDrivers
#endif
+#ifdef SDL_GetNumGPUDrivers
+#undef SDL_GetNumGPUDrivers
+#endif
+
#ifdef SDL_GetNumGamepadTouchpadFingers
#undef SDL_GetNumGamepadTouchpadFingers
#endif
@@ -2792,6 +2867,10 @@
#undef SDL_GetNumJoystickHats
#endif
+#ifdef SDL_GetNumLogicalCPUCores
+#undef SDL_GetNumLogicalCPUCores
+#endif
+
#ifdef SDL_GetNumRenderDrivers
#undef SDL_GetNumRenderDrivers
#endif
@@ -2860,6 +2939,18 @@
#undef SDL_GetPrimarySelectionText
#endif
+#ifdef SDL_GetProcessInput
+#undef SDL_GetProcessInput
+#endif
+
+#ifdef SDL_GetProcessOutput
+#undef SDL_GetProcessOutput
+#endif
+
+#ifdef SDL_GetProcessProperties
+#undef SDL_GetProcessProperties
+#endif
+
#ifdef SDL_GetPropertyType
#undef SDL_GetPropertyType
#endif
@@ -3540,6 +3631,10 @@
#undef SDL_JoystickEventsEnabled
#endif
+#ifdef SDL_KillProcess
+#undef SDL_KillProcess
+#endif
+
#ifdef SDL_LoadBMP
#undef SDL_LoadBMP
#endif
@@ -3876,6 +3971,10 @@
#undef SDL_ReadIO
#endif
+#ifdef SDL_ReadProcess
+#undef SDL_ReadProcess
+#endif
+
#ifdef SDL_ReadS16BE
#undef SDL_ReadS16BE
#endif
@@ -4288,6 +4387,10 @@
#undef SDL_SetCursor
#endif
+#ifdef SDL_SetEnvironmentVariable
+#undef SDL_SetEnvironmentVariable
+#endif
+
#ifdef SDL_SetError
#undef SDL_SetError
#endif
@@ -4880,6 +4983,10 @@
#undef SDL_UnregisterApp
#endif
+#ifdef SDL_UnsetEnvironmentVariable
+#undef SDL_UnsetEnvironmentVariable
+#endif
+
#ifdef SDL_UpdateGamepads
#undef SDL_UpdateGamepads
#endif
@@ -4976,6 +5083,10 @@
#undef SDL_WaitForGPUIdle
#endif
+#ifdef SDL_WaitProcess
+#undef SDL_WaitProcess
+#endif
+
#ifdef SDL_WaitSemaphore
#undef SDL_WaitSemaphore
#endif
@@ -5224,6 +5335,10 @@
#undef SDL_getenv
#endif
+#ifdef SDL_getenv_unsafe
+#undef SDL_getenv_unsafe
+#endif
+
#ifdef SDL_hid_ble_scan
#undef SDL_hid_ble_scan
#endif
@@ -5520,8 +5635,8 @@
#undef SDL_scalbnf
#endif
-#ifdef SDL_setenv
-#undef SDL_setenv
+#ifdef SDL_setenv_unsafe
+#undef SDL_setenv_unsafe
#endif
#ifdef SDL_sin
@@ -5692,8 +5807,8 @@
#undef SDL_ultoa
#endif
-#ifdef SDL_unsetenv
-#undef SDL_unsetenv
+#ifdef SDL_unsetenv_unsafe
+#undef SDL_unsetenv_unsafe
#endif
#ifdef SDL_utf8strlcpy
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index db659e6..d974d4d 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -254,7 +254,7 @@ SDL3_SYM(SDL_AudioDeviceID,GetAudioStreamDevice,(SDL_AudioStream *a),(a),return)
SDL3_SYM(const char*,GetBasePath,(void),(),return)
SDL3_SYM(SDL_bool,GetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return)
SDL3_SYM_PASSTHROUGH(int,GetCPUCacheLineSize,(void),(),return)
-SDL3_SYM_PASSTHROUGH(int,GetCPUCount,(void),(),return)
+SDL3_SYM_RENAMED(int,GetCPUCount,GetNumLogicalCPUCores,(void),(),return)
SDL3_SYM_PASSTHROUGH(char*,GetClipboardText,(void),(),return)
SDL3_SYM(SDL_bool,GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, SDL_bool e, SDL_DisplayMode *f),(a,b,c,d,e,f),return)
SDL3_SYM_PASSTHROUGH(const char*,GetCurrentAudioDriver,(void),(),return)
@@ -274,6 +274,8 @@ SDL3_SYM(SDL_DisplayID,GetDisplayForWindow,(SDL_Window *a),(a),return)
SDL3_SYM(const char*,GetDisplayName,(SDL_DisplayID a),(a),return)
SDL3_SYM(SDL_bool,GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return)
SDL3_SYM(SDL_DisplayID*,GetDisplays,(int *a),(a),return)
+SDL3_SYM(SDL_Environment*,GetEnvironment,(void),(),return)
+SDL3_SYM(const char*,GetEnvironmentVariable,(SDL_Environment *a, const char *b),(a,b),return)
SDL3_SYM_PASSTHROUGH(const char*,GetError,(void),(),return)
SDL3_SYM(SDL_bool,GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),)
SDL3_SYM(float,GetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return)
@@ -606,6 +608,7 @@ SDL3_SYM(SDL_bool,SetAudioStreamPutCallback,(SDL_AudioStream *a, SDL_AudioStream
SDL3_SYM(SDL_bool,SetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return)
SDL3_SYM_PASSTHROUGH_RETCODE(SDL_bool,SetClipboardText,(const char *a),(a),return)
SDL3_SYM(SDL_bool,SetCursor,(SDL_Cursor *a),(a),return)
+SDL3_SYM(SDL_bool,SetEnvironmentVariable,(SDL_Environment *a, const char *b, const char *c, SDL_bool d),(a,b,c,d),return)
SDL3_SYM(void,SetEventEnabled,(Uint32 a, SDL_bool b),(a,b),)
SDL3_SYM(void,SetEventFilter,(SDL_EventFilter a, void *b),(a,b),)
SDL3_SYM(void,SetGamepadEventsEnabled,(SDL_bool a),(a),)
@@ -798,7 +801,7 @@ SDL3_SYM_PASSTHROUGH(double,round,(double a),(a),return)
SDL3_SYM_PASSTHROUGH(float,roundf,(float a),(a),return)
SDL3_SYM_PASSTHROUGH(double,scalbn,(double a, int b),(a,b),return)
SDL3_SYM_PASSTHROUGH(float,scalbnf,(float a, int b),(a,b),return)
-SDL3_SYM_PASSTHROUGH(int,setenv,(const char *a, const char *b, int c),(a,b,c),return)
+SDL3_SYM_RENAMED(int,setenv,setenv_unsafe,(const char *a, const char *b, int c),(a,b,c),return)
SDL3_SYM_PASSTHROUGH(double,sin,(double a),(a),return)
SDL3_SYM_PASSTHROUGH(float,sinf,(float a),(a),return)
SDL3_SYM_PASSTHROUGH(double,sqrt,(double a),(a),return)