]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/fifo: specialize fmt::formater<> for rados::cls::fifo::info
authorKefu Chai <tchaikov@gmail.com>
Wed, 14 Dec 2022 00:20:42 +0000 (08:20 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 14 Dec 2022 03:01:43 +0000 (11:01 +0800)
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<rados::cls::fifo::info> is defined so
the tree can compile with fmt v9.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/cls/fifo/cls_fifo_types.h

index 13f479fe64ab959f831a60ac5778c74e2b2d3295..856732bcb79edc0cec127da0e1f7d08c10e8af3b 100644 (file)
@@ -25,7 +25,9 @@
 #undef FMT_HEADER_ONLY
 #define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
-
+#if FMT_VERSION >= 90000
+#include <fmt/ostream.h>
+#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<rados::cls::fifo::info> : fmt::ostream_formatter {};
+template<>
+struct fmt::formatter<rados::cls::fifo::part_header> : fmt::ostream_formatter {};
+#endif