My hatred for Windows grows with every passing day

This commit is contained in:
offtkp 2024-09-25 05:05:41 +03:00
commit 9a4f57e4e6

View file

@ -445,18 +445,19 @@ void save(const std::filesystem::path& path) {
return; return;
} }
} else { } else {
#ifdef _WIN32
#define PREFIX(str) L##str
#else
#define PREFIX(str) str
#endif
if (error) { if (error) {
fmt::print(PREFIX("Filesystem error accessing {}"), path.native()); fmt::print("Filesystem error: {}\n", error.message());
// can't mix wstring and string in fmt }
fmt::print(" (error: {})\n", error.message());
try {
// Printing wstring (which a path is natively on Windows) to console is generally shaky.
// There's an open issue on fmtlib (#3491) where doing so can cause a crash, and it has
// happened to us too. We're going to assume the path can be converted to a string and
// printed safely, not printing the path if it can't.
fmt::print("Saving new configuration file {}\n", path.string());
} catch (...) {
fmt::print("Saving new configuration file\n");
} }
fmt::print(PREFIX("Saving new configuration file {}\n"), path.native());
#undef PREFIX
} }
data["General"]["isPS4Pro"] = isNeo; data["General"]["isPS4Pro"] = isNeo;