]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/net: prefer <fmt/chrono.h> over <fmt/time.h>
authorKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 08:02:06 +0000 (16:02 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 28 Apr 2019 08:02:25 +0000 (16:02 +0800)
in latest libfmt, <fmt/time.h> is deprecated.

to silence warnings like

/home/kchai/ceph/src/fmt/include/fmt/time.h:13:2: warning: #warning
fmt/time.h is deprecated, use fmt/chrono.h instead [-Wcpp]
 #warning fmt/time.h is deprecated, use fmt/chrono.h instead
  ^~~~~~~
In file included from
/home/kchai/ceph/src/seastar/include/seastar/core/reactor.hh:72:0,
                 from
/home/kchai/ceph/src/seastar/include/seastar/core/sharded.hh:24,
                 from /home/kchai/ceph/src/crimson/net/Fwd.h:18,
                 from /home/kchai/ceph/src/crimson/net/Protocol.h:9,
                 from /home/kchai/ceph/src/crimson/net/ProtocolV2.h:6,
                 from /home/kchai/ceph/src/crimson/net/ProtocolV2.cc:4:

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/net/ProtocolV2.cc

index 6fdc7163e04919927d19b16bdc0e50bb1691a4e3..c9b9ff81982338a811556d772d49a3f85302008a 100644 (file)
@@ -5,8 +5,11 @@
 
 #include <seastar/core/lowres_clock.hh>
 #include <fmt/format.h>
+#if __has_include(<fmt/chrono.h>)
+#include <fmt/chrono.h>
+#else
 #include <fmt/time.h>
-
+#endif
 #include "include/msgr.h"
 #include "include/random.h"