]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
*: include fmt/ostream.h if FMT_VERSION >= 9
authorKefu Chai <tchaikov@gmail.com>
Fri, 25 Nov 2022 08:52:29 +0000 (16:52 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 25 Nov 2022 09:08:23 +0000 (17:08 +0800)
before this change, we assume that `fmt/ostream.h` is included, and
reference `fmt::ostream_formatter`. this breaks the build if the tree
is compiled on {fmt} v9 and up.

after this change, `fmt/ostream.h` is conditionally included. as the
compiling unit is supposed to include fmt headers before including
headers in this project, we can tell if fmt/ostream.h is needed or not
by checking the FMT_VERSION macro.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/common/ceph_time.h
src/crush/CrushLocation.h
src/include/uuid.h
src/msg/Message.h
src/osd/osd_types_fmt.h

index 22429fa282a85b63c9ac10845567103f5efd1fc4..2d3d1fda010e596751221021626bb8c4516a8661 100644 (file)
@@ -19,6 +19,9 @@
 #include <iostream>
 #include <string>
 #include <optional>
+#if FMT_VERSION >= 90000
+#include <fmt/ostream.h>
+#endif
 #include <sys/time.h>
 
 #if defined(__APPLE__)
index 24f43068d6171761521284da8e431b90df0e8cd3..2d2d4b52b9669b3f181dc015ca7dc7e02c4e7a9c 100644 (file)
@@ -7,6 +7,9 @@
 #include <iosfwd>
 #include <map>
 #include <string>
+#if FMT_VERSION >= 90000
+#include <fmt/ostream.h>
+#endif
 
 #include "common/ceph_mutex.h"
 #include "include/common_fwd.h"
index 6a30aa621c443e6d7ff256802c911d98ddff5332..f6ef9878daee729220409c9f3ed24261adaf9b4f 100644 (file)
 #include <boost/uuid/uuid_generators.hpp>
 #include <boost/uuid/uuid_io.hpp>
 
+#if FMT_VERSION >= 90000
+#include <fmt/ostream.h>
+#endif
+
 namespace ceph {
   class Formatter;
 }
index 3a18c82a28062f9498abd214adcdb7732da9ff0d..6ebf06346c3f06a72f21365904efb92b4fc8733a 100644 (file)
@@ -21,6 +21,9 @@
 #include <string_view>
 
 #include <boost/intrusive/list.hpp>
+#if FMT_VERSION >= 90000
+#include <fmt/ostream.h>
+#endif
 
 #include "include/Context.h"
 #include "common/RefCountedObj.h"
index 2a43fe893ee5db43dc433552c42381242ca80df7..5756abcb0929e23ac8b7419e34bb171ca28c745e 100644 (file)
@@ -8,6 +8,9 @@
 #include "common/hobject_fmt.h"
 #include "osd/osd_types.h"
 #include <fmt/chrono.h>
+#if FMT_VERSION >= 90000
+#include <fmt/ostream.h>
+#endif
 
 template <>
 struct fmt::formatter<osd_reqid_t> {