Skip to content

Commit ca39a3b

Browse files
Check for TOML_EXCEPTIONS when loading TOMLs.
1 parent b4b4aac commit ca39a3b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

PowerRecomp/recompiler_config.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
void RecompilerConfig::Load(const std::string_view& configFilePath)
44
{
55
directoryPath = configFilePath.substr(0, configFilePath.find_last_of("\\/") + 1);
6-
toml::table toml = toml::parse_file(configFilePath);
6+
toml::table toml = toml::parse_file(configFilePath)
7+
#if !TOML_EXCEPTIONS
8+
.table()
9+
#endif
10+
;
711

812
if (auto mainPtr = toml["main"].as_table())
913
{
@@ -56,7 +60,11 @@ void RecompilerConfig::Load(const std::string_view& configFilePath)
5660

5761
if (!switchTableFilePath.empty())
5862
{
59-
toml::table switchToml = toml::parse_file(directoryPath + switchTableFilePath);
63+
toml::table switchToml = toml::parse_file(directoryPath + switchTableFilePath)
64+
#if !TOML_EXCEPTIONS
65+
.table()
66+
#endif
67+
;
6068
if (auto switchArray = switchToml["switch"].as_array())
6169
{
6270
for (auto& entry : *switchArray)

0 commit comments

Comments
 (0)