Skip to content

Commit

Permalink
Revert "update for new thread-safe environment functions in SDL3"
Browse files Browse the repository at this point in the history
This reverts commit 3d8376d.

SDL_getenv() is back!
  • Loading branch information
slouken committed Sep 15, 2024
1 parent 5b0364e commit 809804e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/playmus.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int main(int argc, char *argv[])
Mix_VolumeMusic(audio_volume);

/* Set the external music player, if any */
Mix_SetMusicCMD(SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "MUSIC_CMD"));
Mix_SetMusicCMD(SDL_getenv("MUSIC_CMD"));

while (argv[i]) {
next_track = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/music_timidity.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int TIMIDITY_Open(const SDL_AudioSpec *spec)

(void) spec;

cfg = SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "TIMIDITY_CFG");
cfg = SDL_getenv("TIMIDITY_CFG");
if(!cfg) cfg = Mix_GetTimidityCfg();
if (cfg) {
return Timidity_Init(cfg); /* env or user override: no other tries */
Expand Down
2 changes: 1 addition & 1 deletion src/effects_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int _Mix_effects_max_speed = 0;

void _Mix_InitEffects(void)
{
_Mix_effects_max_speed = (SDL_GetEnvironmentVariable(SDL_GetEnvironment(), MIX_EFFECTSMAXSPEED) != NULL);
_Mix_effects_max_speed = (SDL_getenv(MIX_EFFECTSMAXSPEED) != NULL);
}

void _Mix_DeinitEffects(void)
Expand Down
2 changes: 1 addition & 1 deletion src/music.c
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ SDL_bool Mix_SetSoundFonts(const char *paths)

const char* Mix_GetSoundFonts(void)
{
const char *env_paths = SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_SOUNDFONTS");
const char *env_paths = SDL_getenv("SDL_SOUNDFONTS");
SDL_bool force_env_paths = SDL_GetHintBoolean("SDL_FORCE_SOUNDFONTS", SDL_FALSE);
if (force_env_paths && (!env_paths || !*env_paths)) {
force_env_paths = SDL_FALSE;
Expand Down

0 comments on commit 809804e

Please sign in to comment.