From 138738075b95d3d8eae3468daa542c0270965299 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Jul 2022 10:01:11 +0200 Subject: [PATCH] libfmt 9 support libfmt version 9 broke the API by removing fmt::make_args_checked(). Fixes https://bugs.debian.org/1014543 --- NEWS | 1 + src/Log.hxx | 5 ++++- src/client/Response.hxx | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index deca41469..1144fa406 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.23.8 (not yet released) - curl: fix crash if web server does not understand WebDAV * output - pipewire: fix crash with PipeWire 0.3.53 +* support libfmt 9 ver 0.23.7 (2022/05/09) * database diff --git a/src/Log.hxx b/src/Log.hxx index 186131087..3ca8b95b2 100644 --- a/src/Log.hxx +++ b/src/Log.hxx @@ -45,7 +45,10 @@ void LogFmt(LogLevel level, const Domain &domain, const S &format_str, Args&&... args) noexcept { -#if FMT_VERSION >= 70000 +#if FMT_VERSION >= 90000 + return LogVFmt(level, domain, format_str, + fmt::make_format_args(args...)); +#elif FMT_VERSION >= 70000 return LogVFmt(level, domain, fmt::to_string_view(format_str), fmt::make_args_checked(format_str, args...)); diff --git a/src/client/Response.hxx b/src/client/Response.hxx index 7955d07c1..6f9e7da33 100644 --- a/src/client/Response.hxx +++ b/src/client/Response.hxx @@ -82,7 +82,10 @@ public: template bool Fmt(const S &format_str, Args&&... args) noexcept { -#if FMT_VERSION >= 70000 +#if FMT_VERSION >= 90000 + return VFmt(format_str, + fmt::make_format_args(args...)); +#elif FMT_VERSION >= 70000 return VFmt(fmt::to_string_view(format_str), fmt::make_args_checked(format_str, args...)); @@ -109,7 +112,10 @@ public: template void FmtError(enum ack code, const S &format_str, Args&&... args) noexcept { -#if FMT_VERSION >= 70000 +#if FMT_VERSION >= 90000 + return VFmtError(code, format_str, + fmt::make_format_args(args...)); +#elif FMT_VERSION >= 70000 return VFmtError(code, fmt::to_string_view(format_str), fmt::make_args_checked(format_str, args...));