Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Properly define `SDL_getenv_unsafe` to fix Steam controls

Nintorch1c3335e8fdca
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 84fac8bc15b..d9bd4c2433d 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -1037,6 +1037,7 @@ Patches:
- `0007-ios-accelerometer.patch` ([GH-120373](https://github.com/godotengine/godot/pull/120373))
- `0008-ios-link.patch` ([GH-123903](https://github.com/godotengine/godot/pull/123903))
- `0009-ios-iostream-no-prefpath.patch` ([GH-123899](https://github.com/godotengine/godot/pull/123899))
+- `0010-fix-linux-getenv-unsafe.patch` ([GH-124017](https://github.com/godotengine/godot/pull/124017))
## spirv-cross
diff --git a/thirdparty/sdl/patches/0010-fix-linux-getenv-unsafe.patch b/thirdparty/sdl/patches/0010-fix-linux-getenv-unsafe.patch
new file mode 100644
index 00000000000..65cfe1b3075
--- /dev/null
+++ b/thirdparty/sdl/patches/0010-fix-linux-getenv-unsafe.patch
@@ -0,0 +1,13 @@
+diff --git a/thirdparty/sdl/stdlib/SDL_getenv.c b/thirdparty/sdl/stdlib/SDL_getenv.c
+index 17220c69ae..50a511262b 100644
+--- a/thirdparty/sdl/stdlib/SDL_getenv.c
++++ b/thirdparty/sdl/stdlib/SDL_getenv.c
+@@ -555,7 +555,7 @@ int SDL_unsetenv_unsafe(const char *name)
+ #endif // HAVE_LIBC_ENVIRONMENT
+
+ // Retrieve a variable named "name" from the environment
+-#ifdef HAVE_LIBC_ENVIRONMENT
++#if defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_MACOS) || defined(SDL_PLATFORM_FREEBSD)
+ const char *SDL_getenv_unsafe(const char *name)
+ {
+ #ifdef SDL_PLATFORM_ANDROID
diff --git a/thirdparty/sdl/stdlib/SDL_getenv.c b/thirdparty/sdl/stdlib/SDL_getenv.c
index 17220c69ae6..50a511262b9 100644
--- a/thirdparty/sdl/stdlib/SDL_getenv.c
+++ b/thirdparty/sdl/stdlib/SDL_getenv.c
@@ -555,7 +555,7 @@ int SDL_unsetenv_unsafe(const char *name)
#endif // HAVE_LIBC_ENVIRONMENT
// Retrieve a variable named "name" from the environment
-#ifdef HAVE_LIBC_ENVIRONMENT
+#if defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_MACOS) || defined(SDL_PLATFORM_FREEBSD)
const char *SDL_getenv_unsafe(const char *name)
{
#ifdef SDL_PLATFORM_ANDROID