From 2c37fb1f5eaf6a59c30be59580ea59f8774f416d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 2 Feb 2020 23:41:17 +0100 Subject: [PATCH] Add HAVE_CONFIGFILE ifdefs --- configuration.c | 2 ++ retroarch.c | 10 ++++++++-- retroarch.h | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configuration.c b/configuration.c index ba453deb93..b4ac390740 100644 --- a/configuration.c +++ b/configuration.c @@ -2432,11 +2432,13 @@ void config_set_defaults(void *data) strlcpy(settings->arrays.midi_output, midi_output, sizeof(settings->arrays.midi_output)); +#ifdef HAVE_CONFIGFILE /* Avoid reloading config on every content load */ if (DEFAULT_BLOCK_CONFIG_READ) rarch_ctl(RARCH_CTL_SET_BLOCK_CONFIG_READ, NULL); else rarch_ctl(RARCH_CTL_UNSET_BLOCK_CONFIG_READ, NULL); +#endif #ifdef HAVE_MENU first_initialized = false; diff --git a/retroarch.c b/retroarch.c index ebe59e5b69..4142181f0f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1074,7 +1074,6 @@ static bool has_set_core = false; #ifdef HAVE_DISCORD bool discord_is_inited = false; #endif -static bool rarch_block_config_read = false; static bool rarch_is_inited = false; static bool rarch_error_on_init = false; static bool rarch_force_fullscreen = false; @@ -1111,6 +1110,7 @@ static bool runloop_core_shutdown_initiated = false; static bool runloop_core_running = false; static bool runloop_perfcnt_enable = false; #ifdef HAVE_CONFIGFILE +static bool rarch_block_config_read = false; static bool runloop_overrides_active = false; static bool runloop_remaps_core_active = false; static bool runloop_remaps_game_active = false; @@ -7909,7 +7909,6 @@ static void global_free(void) command_event(CMD_EVENT_RECORD_DEINIT, NULL); command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL); - rarch_block_config_read = false; rarch_is_sram_load_disabled = false; rarch_is_sram_save_disabled = false; rarch_use_sram = false; @@ -7918,6 +7917,7 @@ static void global_free(void) rarch_ctl(RARCH_CTL_UNSET_UPS_PREF, NULL); rarch_patch_blocked = false; #ifdef HAVE_CONFIGFILE + rarch_block_config_read = false; runloop_overrides_active = false; runloop_remaps_core_active = false; runloop_remaps_game_active = false; @@ -7985,7 +7985,9 @@ void main_exit(void *args) has_set_username = false; rarch_is_inited = false; rarch_error_on_init = false; +#ifdef HAVE_CONFIGFILE rarch_block_config_read = false; +#endif retroarch_msg_queue_deinit(); driver_uninit(DRIVERS_CMD_ALL); @@ -24665,7 +24667,9 @@ static void retroarch_parse_input_and_config(int argc, char *argv[]) current_core.has_set_subsystems = false; /* Load the config file now that we know what it is */ +#ifdef HAVE_CONFIGFILE if (!rarch_block_config_read) +#endif { config_set_defaults(&g_extern); #ifdef HAVE_CONFIGFILE @@ -25869,12 +25873,14 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) sthread_tls_delete(&rarch_tls); #endif break; +#ifdef HAVE_CONFIGFILE case RARCH_CTL_SET_BLOCK_CONFIG_READ: rarch_block_config_read = true; break; case RARCH_CTL_UNSET_BLOCK_CONFIG_READ: rarch_block_config_read = false; break; +#endif case RARCH_CTL_GET_CORE_OPTION_SIZE: { unsigned *idx = (unsigned*)data; diff --git a/retroarch.h b/retroarch.h index 3c3c5d9125..52f182b3e5 100644 --- a/retroarch.h +++ b/retroarch.h @@ -100,9 +100,11 @@ enum rarch_ctl_state RARCH_CTL_IS_IPS_PREF, RARCH_CTL_UNSET_IPS_PREF, +#ifdef HAVE_CONFIGFILE /* Block config read */ RARCH_CTL_SET_BLOCK_CONFIG_READ, RARCH_CTL_UNSET_BLOCK_CONFIG_READ, +#endif /* Username */ RARCH_CTL_HAS_SET_USERNAME,