Closed sezero closed 2 months ago
I tried using SDL3 _unsafe versions for SDL_getenv and SDL_setenv, like:
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -517,18 +517,6 @@ SDL_ClearHints(void)
SDL3_ResetHints();
}
-SDL_DECLSPEC const char * SDLCALL
-SDL_getenv(const char *name)
-{
- return SDL3_GetEnvironmentVariable(SDL3_GetEnvironment(), name);
-}
-
-SDL_DECLSPEC int SDLCALL
-SDL_setenv(const char *name, const char *value, int overwrite)
-{
- return SDL3_SetEnvironmentVariable(SDL3_GetEnvironment(), name, value, !!overwrite);
-}
-
static void
SDL2Compat_ApplyQuirks(SDL_bool force_x11)
{
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -742,6 +742,7 @@ SDL3_SYM_PASSTHROUGH(float,floorf,(float a),(a),return)
SDL3_SYM_PASSTHROUGH(double,fmod,(double a, double b),(a,b),return)
SDL3_SYM_PASSTHROUGH(float,fmodf,(float a, float b),(a,b),return)
SDL3_SYM_PASSTHROUGH(void,free,(void *a),(a),)
+SDL3_SYM_RENAMED(const char*,getenv,getenv_unsafe,(const char *a),(a),return)
SDL3_SYM(void,hid_ble_scan,(SDL_bool a),(a),)
SDL3_SYM(int,hid_close,(SDL_hid_device *a),(a),return)
SDL3_SYM_PASSTHROUGH(Uint32,hid_device_change_count,(void),(),return)
@@ -801,6 +802,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_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)
... but still failing. More tired...
Thanks for updating this, I'm taking a look.
Tests are failing, haven't investigated why (tired.) Please have a look.