diff --git a/dynamic.c b/dynamic.c index 38d280d76b..ee9d31a6eb 100644 --- a/dynamic.c +++ b/dynamic.c @@ -67,6 +67,7 @@ static dylib_t lib_handle; #endif struct retro_core_t core; +static bool ignore_environment_cb; #ifdef HAVE_DYNAMIC static bool *load_no_content_hook; @@ -114,9 +115,9 @@ void libretro_get_environment_info(void (*func)(retro_environment_t), /* It's possible that we just set get_system_info callback to the currently running core. * Make sure we reset it to the actual environment callback. * Ignore any environment callbacks here in case we're running on the non-current core. */ - rarch_environment_cb(RETRO_ENVIRONMENT_SET_IGNORE_ENVIRON_CB, NULL); + ignore_environment_cb = true; func(rarch_environment_cb); - rarch_environment_cb(RETRO_ENVIRONMENT_UNSET_IGNORE_ENVIRON_CB, NULL); + ignore_environment_cb = false; } static dylib_t libretro_get_system_info_lib(const char *path, @@ -603,10 +604,9 @@ static void rarch_log_libretro(enum retro_log_level level, bool rarch_environment_cb(unsigned cmd, void *data) { unsigned p; - static bool ignore_environment_cb = false; - settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); - rarch_system_info_t *system = rarch_system_info_get_ptr(); + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); + rarch_system_info_t *system = rarch_system_info_get_ptr(); if (ignore_environment_cb) return false; @@ -1232,12 +1232,6 @@ bool rarch_environment_cb(unsigned cmd, void *data) RARCH_LOG("Environ (Private) EXEC.\n"); } break; - case RETRO_ENVIRONMENT_SET_IGNORE_ENVIRON_CB: - ignore_environment_cb = true; - break; - case RETRO_ENVIRONMENT_UNSET_IGNORE_ENVIRON_CB: - ignore_environment_cb = false; - break; default: RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd); diff --git a/libretro_private.h b/libretro_private.h index 1badd414a1..7d1a3cccda 100644 --- a/libretro_private.h +++ b/libretro_private.h @@ -60,10 +60,6 @@ * _EXEC. NULL means no game. */ -#define RETRO_ENVIRONMENT_SET_IGNORE_ENVIRON_CB (RETRO_ENVIRONMENT_PRIVATE | 3) - -#define RETRO_ENVIRONMENT_UNSET_IGNORE_ENVIRON_CB (RETRO_ENVIRONMENT_PRIVATE | 4) - #endif