diff --git a/src/fatfs/ff.h b/src/fatfs/ff.h index 1662d836..88ff1f71 100644 --- a/src/fatfs/ff.h +++ b/src/fatfs/ff.h @@ -40,8 +40,8 @@ extern "C" { #include typedef unsigned __int64 QWORD; #include -#define isnan(v) _isnan(v) -#define isinf(v) (!_finite(v)) +//#define isnan(v) _isnan(v) +//#define isinf(v) (!_finite(v)) #elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */ #define FF_INTDEF 2 diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp index 8b4d1862..8cdc75a2 100644 --- a/src/frontend/qt_sdl/Config.cpp +++ b/src/frontend/qt_sdl/Config.cpp @@ -320,8 +320,37 @@ LegacyEntry LegacyFile[] = static std::string GetDefaultKey(std::string path) { - std::regex re("(Instance|Window)(\\d+)\\."); - return std::regex_replace(path, re, "$1*."); + std::string tables[] = {"Instance", "Window", "Camera"}; + + std::string ret = ""; + int plen = path.length(); + for (int i = 0; i < plen;) + { + bool found = false; + + for (auto& tbl : tables) + { + int tlen = tbl.length(); + if ((plen-i) <= tlen) continue; + if (path.substr(i, tlen) != tbl) continue; + if (path[i+tlen] < '0' || path[i+tlen] > '9') continue; + + ret += tbl + "*"; + i = path.find('.', i+tlen); + if (i == std::string::npos) return ret; + + found = true; + break; + } + + if (!found) + { + ret += path[i]; + i++; + } + } + + return ret; } diff --git a/src/frontend/qt_sdl/Config.h b/src/frontend/qt_sdl/Config.h index 410ea250..d69dd117 100644 --- a/src/frontend/qt_sdl/Config.h +++ b/src/frontend/qt_sdl/Config.h @@ -25,12 +25,7 @@ #include #include -#ifndef TOML11_VALUE_HPP -namespace toml -{ -class value; -} -#endif +#include "toml/value.hpp" namespace Config {