From 662163163c21ef1b48dc1cf379402fc38ac2f0f7 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 14 Dec 2022 08:20:42 +0800 Subject: [PATCH] cls/fifo: specialize fmt::formater<> for rados::cls::fifo::info since fmt v9, fmt::formatter<> is not specialized for the types with operator<<(ostream&, ...) anymore. so we need to specialize it manually. in this change, fmt::formatter is defined so the tree can compile with fmt v9. Signed-off-by: Kefu Chai --- src/cls/fifo/cls_fifo_types.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cls/fifo/cls_fifo_types.h b/src/cls/fifo/cls_fifo_types.h index 13f479fe64ab9..856732bcb79ed 100644 --- a/src/cls/fifo/cls_fifo_types.h +++ b/src/cls/fifo/cls_fifo_types.h @@ -25,7 +25,9 @@ #undef FMT_HEADER_ONLY #define FMT_HEADER_ONLY 1 #include - +#if FMT_VERSION >= 90000 +#include +#endif #include "include/buffer.h" #include "include/encoding.h" #include "include/types.h" @@ -522,3 +524,10 @@ inline std::ostream& operator <<(std::ostream& m, const part_header& p) { << "max_time: " << p.max_time; } } // namespace rados::cls::fifo + +#if FMT_VERSION >= 90000 +template<> +struct fmt::formatter : fmt::ostream_formatter {}; +template<> +struct fmt::formatter : fmt::ostream_formatter {}; +#endif -- 2.39.5