Check for TOML_EXCEPTIONS when loading TOMLs.

This commit is contained in:
Skyth 2025-01-13 21:15:19 +03:00
parent b4b4aac788
commit ca39a3b992

View File

@ -3,7 +3,11 @@
void RecompilerConfig::Load(const std::string_view& configFilePath) void RecompilerConfig::Load(const std::string_view& configFilePath)
{ {
directoryPath = configFilePath.substr(0, configFilePath.find_last_of("\\/") + 1); 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()) if (auto mainPtr = toml["main"].as_table())
{ {
@ -56,7 +60,11 @@ void RecompilerConfig::Load(const std::string_view& configFilePath)
if (!switchTableFilePath.empty()) 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()) if (auto switchArray = switchToml["switch"].as_array())
{ {
for (auto& entry : *switchArray) for (auto& entry : *switchArray)