From 6016f2e298a47355a954cca2644852b38530a680 Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Thu, 3 Oct 2024 06:48:25 +0000 Subject: [PATCH] Add support for fmt 11 (#1366) --- src/Cemu/Logging/CemuLogging.h | 4 ++++ src/config/CemuConfig.h | 10 +++++----- src/gui/helpers/wxHelpers.h | 2 +- src/input/emulated/EmulatedController.h | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Cemu/Logging/CemuLogging.h b/src/Cemu/Logging/CemuLogging.h index 25e3ec17..cf5f4787 100644 --- a/src/Cemu/Logging/CemuLogging.h +++ b/src/Cemu/Logging/CemuLogging.h @@ -92,7 +92,11 @@ bool cemuLog_log(LogType type, std::basic_string formatStr, TArgs&&... args) else { const auto format_view = fmt::basic_string_view(formatStr); +#if FMT_VERSION >= 110000 + const auto text = fmt::vformat(format_view, fmt::make_format_args>(args...)); +#else const auto text = fmt::vformat(format_view, fmt::make_format_args>(args...)); +#endif cemuLog_log(type, std::basic_string_view(text.data(), text.size())); } return true; diff --git a/src/config/CemuConfig.h b/src/config/CemuConfig.h index e45a8695..47a05e27 100644 --- a/src/config/CemuConfig.h +++ b/src/config/CemuConfig.h @@ -191,7 +191,7 @@ ENABLE_ENUM_ITERATORS(CrashDump, CrashDump::Disabled, CrashDump::Enabled); template <> struct fmt::formatter : formatter { template - auto format(const PrecompiledShaderOption c, FormatContext &ctx) { + auto format(const PrecompiledShaderOption c, FormatContext &ctx) const { string_view name; switch (c) { @@ -206,7 +206,7 @@ struct fmt::formatter : formatter { template <> struct fmt::formatter : formatter { template - auto format(const AccurateShaderMulOption c, FormatContext &ctx) { + auto format(const AccurateShaderMulOption c, FormatContext &ctx) const { string_view name; switch (c) { @@ -220,7 +220,7 @@ struct fmt::formatter : formatter { template <> struct fmt::formatter : formatter { template - auto format(const CPUMode c, FormatContext &ctx) { + auto format(const CPUMode c, FormatContext &ctx) const { string_view name; switch (c) { @@ -237,7 +237,7 @@ struct fmt::formatter : formatter { template <> struct fmt::formatter : formatter { template - auto format(const CPUModeLegacy c, FormatContext &ctx) { + auto format(const CPUModeLegacy c, FormatContext &ctx) const { string_view name; switch (c) { @@ -254,7 +254,7 @@ struct fmt::formatter : formatter { template <> struct fmt::formatter : formatter { template - auto format(const CafeConsoleRegion v, FormatContext &ctx) { + auto format(const CafeConsoleRegion v, FormatContext &ctx) const { string_view name; switch (v) { diff --git a/src/gui/helpers/wxHelpers.h b/src/gui/helpers/wxHelpers.h index a69988a3..ae41b54e 100644 --- a/src/gui/helpers/wxHelpers.h +++ b/src/gui/helpers/wxHelpers.h @@ -10,7 +10,7 @@ template <> struct fmt::formatter : formatter { template - auto format(const wxString& str, FormatContext& ctx) + auto format(const wxString& str, FormatContext& ctx) const { return formatter::format(str.c_str().AsChar(), ctx); } diff --git a/src/input/emulated/EmulatedController.h b/src/input/emulated/EmulatedController.h index 18ffad1c..11d31bce 100644 --- a/src/input/emulated/EmulatedController.h +++ b/src/input/emulated/EmulatedController.h @@ -130,7 +130,7 @@ using EmulatedControllerPtr = std::shared_ptr; template <> struct fmt::formatter : formatter { template - auto format(EmulatedController::Type v, FormatContext& ctx) { + auto format(EmulatedController::Type v, FormatContext& ctx) const { switch (v) { case EmulatedController::Type::VPAD: return formatter::format("Wii U Gamepad", ctx);