From 51a81a3ab76e9ae1a60c6cb9169edff0d3e5896f Mon Sep 17 00:00:00 2001 From: Ferdinand Bachmann Date: Sat, 4 Jan 2025 18:45:32 +0100 Subject: [PATCH 1/3] BBA/HLE: Fix incorrect fmt format string --- Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp b/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp index 86d3f894209f..7e5309b7a2ee 100644 --- a/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp +++ b/Source/Core/Core/HW/EXI/BBA/BuiltIn.cpp @@ -686,7 +686,7 @@ bool CEXIETHERNET::BuiltInBBAInterface::SendFrame(const u8* frame, u32 size) } default: - ERROR_LOG_FMT(SP1, "Unsupported EtherType {#06x}", *ethertype); + ERROR_LOG_FMT(SP1, "Unsupported EtherType {:#06x}", *ethertype); return false; } From dc94a15054596645f158fa63bd27a98f509adfd9 Mon Sep 17 00:00:00 2001 From: Ferdinand Bachmann Date: Sat, 4 Jan 2025 18:46:04 +0100 Subject: [PATCH 2/3] Common: Fix compile failure with fmt>=11 --- Source/Core/Common/Logging/Log.h | 8 +++++++- Source/Core/Common/MsgHandler.h | 13 ++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 18177700ee00..e55500c17727 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -100,7 +100,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 23f8e9036d1c..0220c781863d 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); From 248005e5564b74077e8d9410e69049f0cc55b585 Mon Sep 17 00:00:00 2001 From: SilverMight Date: Fri, 9 May 2025 14:21:05 -0400 Subject: [PATCH 3/3] EXIBrawlback: fix incorrect fmt string --- Source/Core/Core/HW/EXI/EXIBrawlback.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/EXI/EXIBrawlback.cpp b/Source/Core/Core/HW/EXI/EXIBrawlback.cpp index 535e976124a2..97b330d62f0d 100644 --- a/Source/Core/Core/HW/EXI/EXIBrawlback.cpp +++ b/Source/Core/Core/HW/EXI/EXIBrawlback.cpp @@ -1212,7 +1212,7 @@ void CEXIBrawlback::handleEndMatch(u8* payload) if (res != 0) { - ERROR_LOG_FMT(BRAWLBACK, "[GameReport] Got error executing request. Err code: {#d}", (int)res); + ERROR_LOG_FMT(BRAWLBACK, "[GameReport] Got error executing request. Err code: {:d}", (int)res); } else {