lib/fmt: require libfmt 9

Version 9 added the "debug format" which I'd like to use.
This commit is contained in:
Max Kellermann
2024-04-16 11:31:07 +02:00
parent 08810991c2
commit 39c9e92f42
12 changed files with 7 additions and 103 deletions

View File

@@ -52,11 +52,7 @@ BufferedOutputStream::VFmt(fmt::string_view format_str, fmt::format_args args)
/* TODO format into this object's buffer instead of allocating
a new one */
fmt::memory_buffer b;
#if FMT_VERSION >= 80000
fmt::vformat_to(std::back_inserter(b), format_str, args);
#else
fmt::vformat_to(b, format_str, args);
#endif
return Write(std::as_bytes(std::span{b.data(), b.size()}));
}

View File

@@ -7,9 +7,6 @@
#include "util/SpanCast.hxx"
#include <fmt/core.h>
#if FMT_VERSION >= 80000 && FMT_VERSION < 90000
#include <fmt/format.h>
#endif
#include <cstddef>
#include <string_view>
@@ -71,14 +68,8 @@ public:
template<typename S, typename... Args>
void Fmt(const S &format_str, Args&&... args) {
#if FMT_VERSION >= 90000
VFmt(format_str,
fmt::make_format_args(args...));
#else
VFmt(fmt::to_string_view(format_str),
fmt::make_args_checked<Args...>(format_str,
args...));
#endif
}
#ifdef _UNICODE