diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index a13e9fee94..4b40297836 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -99,7 +99,13 @@ void GenericLogFmt(LogLevel level, LogType type, const char* file, int line, con static_assert(NumFields == sizeof...(args), "Unexpected number of replacement fields in format string; did you pass too few or " "too many arguments?"); - GenericLogFmtImpl(level, type, file, line, format, fmt::make_format_args(args...)); + +#if FMT_VERSION >= 110000 + auto&& format_str = fmt::format_string(format); +#else + auto&& format_str = format; +#endif + GenericLogFmtImpl(level, type, file, line, format_str, fmt::make_format_args(args...)); } } // namespace Common::Log diff --git a/Source/Core/Common/MsgHandler.h b/Source/Core/Common/MsgHandler.h index 23f8e9036d..0220c78186 100644 --- a/Source/Core/Common/MsgHandler.h +++ b/Source/Core/Common/MsgHandler.h @@ -41,12 +41,17 @@ bool MsgAlertFmt(bool yes_no, MsgType style, Common::Log::LogType log_type, cons static_assert(NumFields == sizeof...(args), "Unexpected number of replacement fields in format string; did you pass too few or " "too many arguments?"); -#if FMT_VERSION >= 90000 +#if FMT_VERSION >= 110000 + static_assert(std::is_base_of_v); + auto&& format_str = fmt::format_string(format); +#elif FMT_VERSION >= 90000 static_assert(fmt::detail::is_compile_string::value); + auto&& format_str = format; #else static_assert(fmt::is_compile_string::value); + auto&& format_str = format; #endif - return MsgAlertFmtImpl(yes_no, style, log_type, file, line, format, + return MsgAlertFmtImpl(yes_no, style, log_type, file, line, format_str, fmt::make_format_args(args...)); } @@ -60,7 +65,9 @@ bool MsgAlertFmtT(bool yes_no, MsgType style, Common::Log::LogType log_type, con static_assert(NumFields == sizeof...(args), "Unexpected number of replacement fields in format string; did you pass too few or " "too many arguments?"); -#if FMT_VERSION >= 90000 +#if FMT_VERSION >= 110000 + static_assert(std::is_base_of_v); +#elif FMT_VERSION >= 90000 static_assert(fmt::detail::is_compile_string::value); #else static_assert(fmt::is_compile_string::value);