Log, client/Response, io/BufferedOutputStream: drop support for libfmt < 7

Remove some compatibility code.
This commit is contained in:
Max Kellermann
2022-11-28 18:51:37 +01:00
parent b09a776a26
commit 7f3868727b
5 changed files with 9 additions and 24 deletions

View File

@@ -23,7 +23,7 @@
#include "protocol/Ack.hxx"
#include <fmt/core.h>
#if FMT_VERSION < 70000 || FMT_VERSION >= 80000
#if FMT_VERSION >= 80000
#include <fmt/format.h>
#endif
@@ -85,14 +85,10 @@ public:
#if FMT_VERSION >= 90000
return VFmt(format_str,
fmt::make_format_args(args...));
#elif FMT_VERSION >= 70000
#else
return VFmt(fmt::to_string_view(format_str),
fmt::make_args_checked<Args...>(format_str,
args...));
#else
/* expensive fallback for older libfmt versions */
const auto result = fmt::format(format_str, args...);
return Write(result.data(), result.size());
#endif
}
@@ -115,14 +111,10 @@ public:
#if FMT_VERSION >= 90000
return VFmtError(code, format_str,
fmt::make_format_args(args...));
#elif FMT_VERSION >= 70000
#else
return VFmtError(code, fmt::to_string_view(format_str),
fmt::make_args_checked<Args...>(format_str,
args...));
#else
/* expensive fallback for older libfmt versions */
const auto result = fmt::format(format_str, args...);
return Error(code, result.c_str());
#endif
}
};