From fe1e6b6c4eb55cd2103309a957a8baecc473021a Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Wed, 26 Oct 2022 20:42:53 +1100 Subject: [PATCH] neorados: compile with fmt v9 neorados FTBFS on openSUSE Tumbleweed which includes fmt version 9. On the assumption it's still desirable to support building with older versions, I've put "#if FMT_VERSION" guards around the additions here. Signed-off-by: Tim Serong --- src/include/neorados/RADOS_Decodable.hpp | 9 +++++++++ src/tools/neorados.cc | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/include/neorados/RADOS_Decodable.hpp b/src/include/neorados/RADOS_Decodable.hpp index 9654a84898a1..83d065b3f0b1 100644 --- a/src/include/neorados/RADOS_Decodable.hpp +++ b/src/include/neorados/RADOS_Decodable.hpp @@ -24,6 +24,11 @@ #include #include +#include +#if FMT_VERSION >= 90000 +#include +#endif + namespace neorados { struct Entry { std::string nspace; @@ -104,4 +109,8 @@ struct hash<::neorados::Entry> { }; } +#if FMT_VERSION >= 90000 +template <> struct fmt::formatter : ostream_formatter {}; +#endif + #endif // RADOS_DECODABLE_HPP diff --git a/src/tools/neorados.cc b/src/tools/neorados.cc index 516dfbce7fe6..24966d2aee5e 100644 --- a/src/tools/neorados.cc +++ b/src/tools/neorados.cc @@ -293,6 +293,10 @@ const std::array commands = { "remove OBJECT in POOL"sv } }; +#if FMT_VERSION >= 90000 +template <> struct fmt::formatter : ostream_formatter {}; +#endif // FMT_VERSION + int main(int argc, char* argv[]) { const std::string_view prog(argv[0]); -- 2.47.3