From: Kefu Chai Date: Fri, 25 Nov 2022 08:52:29 +0000 (+0800) Subject: *: include fmt/ostream.h if FMT_VERSION >= 9 X-Git-Tag: v18.1.0~777^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85928aff5eb9601520ca3e451728001fb25af0de;p=ceph.git *: include fmt/ostream.h if FMT_VERSION >= 9 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 --- diff --git a/src/common/ceph_time.h b/src/common/ceph_time.h index 22429fa282a8..2d3d1fda010e 100644 --- a/src/common/ceph_time.h +++ b/src/common/ceph_time.h @@ -19,6 +19,9 @@ #include #include #include +#if FMT_VERSION >= 90000 +#include +#endif #include #if defined(__APPLE__) diff --git a/src/crush/CrushLocation.h b/src/crush/CrushLocation.h index 24f43068d617..2d2d4b52b966 100644 --- a/src/crush/CrushLocation.h +++ b/src/crush/CrushLocation.h @@ -7,6 +7,9 @@ #include #include #include +#if FMT_VERSION >= 90000 +#include +#endif #include "common/ceph_mutex.h" #include "include/common_fwd.h" diff --git a/src/include/uuid.h b/src/include/uuid.h index 6a30aa621c44..f6ef9878daee 100644 --- a/src/include/uuid.h +++ b/src/include/uuid.h @@ -16,6 +16,10 @@ #include #include +#if FMT_VERSION >= 90000 +#include +#endif + namespace ceph { class Formatter; } diff --git a/src/msg/Message.h b/src/msg/Message.h index 3a18c82a2806..6ebf06346c3f 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -21,6 +21,9 @@ #include #include +#if FMT_VERSION >= 90000 +#include +#endif #include "include/Context.h" #include "common/RefCountedObj.h" diff --git a/src/osd/osd_types_fmt.h b/src/osd/osd_types_fmt.h index 2a43fe893ee5..5756abcb0929 100644 --- a/src/osd/osd_types_fmt.h +++ b/src/osd/osd_types_fmt.h @@ -8,6 +8,9 @@ #include "common/hobject_fmt.h" #include "osd/osd_types.h" #include +#if FMT_VERSION >= 90000 +#include +#endif template <> struct fmt::formatter {