diff --git a/src/backend/core/Mem.cpp b/src/backend/core/Mem.cpp index 8d983115..58d6ed8c 100644 --- a/src/backend/core/Mem.cpp +++ b/src/backend/core/Mem.cpp @@ -87,7 +87,7 @@ FORCE_INLINE void SetROMCIC(u32 checksum, ROM &rom) { } std::vector Mem::OpenArchive(const std::string &path, size_t &sizeAdjusted) { - auto stream = ar_open_file(fs::path(path).u8string().c_str()); + auto stream = ar_open_file(fs::path(path).c_str()); if (!stream) { Util::panic("Could not open archive! Are you sure it's an archive?"); diff --git a/src/utils/log.hpp b/src/utils/log.hpp index a8f70ced..0a2543db 100644 --- a/src/utils/log.hpp +++ b/src/utils/log.hpp @@ -17,73 +17,73 @@ static constexpr auto globalLogLevel = Info; #endif template -constexpr void print(const std::string &fmt, Args... args) { - if constexpr (messageType >= globalLogLevel) { +void print(const std::string &fmt, Args... args) { + if (messageType >= globalLogLevel) { #ifndef _WIN32 - if constexpr (messageType == Error) { - fmt::print(fmt::emphasis::bold | fg(fmt::color::red), fmt, args...); - } else if constexpr (messageType == Warn) { - fmt::print(fg(fmt::color::yellow), fmt, args...); - } else if constexpr (messageType == Info || messageType == Trace || messageType == Always) { - fmt::print(fmt, args...); - } else if constexpr (messageType == Debug) { + if (messageType == Error) { + fmt::print(fmt::emphasis::bold | fg(fmt::color::red), fmt::runtime(fmt), args...); + } else if (messageType == Warn) { + fmt::print(fg(fmt::color::yellow), fmt::runtime(fmt), args...); + } else if (messageType == Info || messageType == Trace || messageType == Always) { + fmt::print(fmt::runtime(fmt), args...); + } else if (messageType == Debug) { #ifndef NDEBUG - fmt::print(fmt, args...); + fmt::print(fmt::runtime(fmt), args...); #endif } #else - if constexpr (messageType == Debug) { + if (messageType == Debug) { #ifndef NDEBUG - fmt::print(fmt, args...); + fmt::print(fmt::runtime(fmt), args...); #endif } else { - fmt::print(fmt, args...); + fmt::print(fmt::runtime(fmt), args...); } #endif } } template -constexpr void panic(const std::string &fmt, Args... args) { +void panic(const std::string &fmt, Args... args) { print("[FATAL] " + fmt + "\n", args...); exit(-1); } template -constexpr void error(const std::string &fmt, Args... args) { +void error(const std::string &fmt, Args... args) { print("[ERROR] " + fmt + "\n", args...); } template -constexpr void warn(const std::string &fmt, Args... args) { +void warn(const std::string &fmt, Args... args) { print("[WARN] " + fmt + "\n", args...); } template -constexpr void info(const std::string &fmt, Args... args) { +void info(const std::string &fmt, Args... args) { print("[INFO] " + fmt + "\n", args...); } template -constexpr void debug(const std::string &fmt, Args... args) { +void debug(const std::string &fmt, Args... args) { print("[DEBUG] " + fmt + "\n", args...); } template -constexpr void trace(const std::string &fmt, Args... args) { +void trace(const std::string &fmt, Args... args) { print("[TRACE] " + fmt + "\n", args...); } template -constexpr void always(const std::string &fmt, Args... args) { +void always(const std::string &fmt, Args... args) { print(fmt + "\n", args...); } template -constexpr void panic_trace(const std::string &fmt, Args... args) { +void panic_trace(const std::string &fmt, Args... args) { #if !defined(NDEBUG) && !defined(_WIN32) Dl_info info; - auto tmp = fmt::format(fmt + '\n', args...); + auto tmp = fmt::format(fmt::runtime(fmt + '\n'), args...); tmp += "Called by:\n"; if (dladdr(__builtin_return_address(0), &info)) tmp += fmt::format("\t-> {}\n", info.dli_sname);