My hatred for Windows grows with every passing day

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

View file

@ -445,18 +445,19 @@ void save(const std::filesystem::path& path) {
return;
}
} else {
#ifdef _WIN32
#define PREFIX(str) L##str
#else
#define PREFIX(str) str
#endif
if (error) {
fmt::print(PREFIX("Filesystem error accessing {}"), path.native());
// can't mix wstring and string in fmt
fmt::print(" (error: {})\n", error.message());
fmt::print("Filesystem 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;