[COMMIT seastar master] Merge 'fmt 9 ostream fix' from longlene

5 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Sep 16, 2022, 1:37:08 AMSep 16
to seastar-dev@googlegroups.com, Pavel Emelyanov
From: Pavel Emelyanov <xe...@scylladb.com>
Committer: Pavel Emelyanov <xe...@scylladb.com>
Branch: master

Merge 'fmt 9 ostream fix' from longlene

Closes #1173

* https://github.com/scylladb/seastar:
formatter for fmt 9
de-anonymize duration class

---
diff --git a/include/seastar/net/ethernet.hh b/include/seastar/net/ethernet.hh
--- a/include/seastar/net/ethernet.hh
+++ b/include/seastar/net/ethernet.hh
@@ -94,3 +94,7 @@ ethernet_address parse_ethernet_address(std::string addr);
}

}
+
+#if FMT_VERSION >= 90000
+template <> struct fmt::formatter<seastar::net::ethernet_address> : fmt::ostream_formatter {};
+#endif
diff --git a/tests/perf/perf_tests.cc b/tests/perf/perf_tests.cc
--- a/tests/perf/perf_tests.cc
+++ b/tests/perf/perf_tests.cc
@@ -41,6 +41,13 @@

#include <signal.h>

+#if FMT_VERSION >= 90000
+namespace perf_tests::internal {
+ struct duration;
+}
+template <> struct fmt::formatter<perf_tests::internal::duration> : fmt::ostream_formatter {};
+#endif
+
namespace perf_tests {
namespace internal {

@@ -160,7 +167,6 @@ struct result {
double inst = 0.;
};

-namespace {

struct duration {
double value;
@@ -183,8 +189,6 @@ static inline std::ostream& operator<<(std::ostream& os, duration d)
return os;
}

-}
-
static constexpr auto header_format_string = "{:<40} {:>11} {:>11} {:>11} {:>11} {:>11} {:>11} {:>11} {:>11}\n";
static constexpr auto format_string = "{:<40} {:>11} {:>11} {:>11} {:>11} {:>11} {:>11.3f} {:>11.3f} {:>11.1f}\n";

Reply all
Reply to author
Forward
0 new messages