From ca39a3b992d52c87eb92c2645e996d4b5b5f2014 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:15:19 +0300 Subject: [PATCH] Check for TOML_EXCEPTIONS when loading TOMLs. --- PowerRecomp/recompiler_config.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PowerRecomp/recompiler_config.cpp b/PowerRecomp/recompiler_config.cpp index 2525d75..31f6a8d 100644 --- a/PowerRecomp/recompiler_config.cpp +++ b/PowerRecomp/recompiler_config.cpp @@ -3,7 +3,11 @@ void RecompilerConfig::Load(const std::string_view& configFilePath) { directoryPath = configFilePath.substr(0, configFilePath.find_last_of("\\/") + 1); - toml::table toml = toml::parse_file(configFilePath); + toml::table toml = toml::parse_file(configFilePath) +#if !TOML_EXCEPTIONS + .table() +#endif + ; if (auto mainPtr = toml["main"].as_table()) { @@ -56,7 +60,11 @@ void RecompilerConfig::Load(const std::string_view& configFilePath) if (!switchTableFilePath.empty()) { - toml::table switchToml = toml::parse_file(directoryPath + switchTableFilePath); + toml::table switchToml = toml::parse_file(directoryPath + switchTableFilePath) +#if !TOML_EXCEPTIONS + .table() +#endif + ; if (auto switchArray = switchToml["switch"].as_array()) { for (auto& entry : *switchArray)