summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-08-28 18:05:23 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2023-08-28 18:05:23 +0200
commit53ba5581070bc8914a35a5e16af901c562923e61 (patch)
tree320a9788c489d64d5669ccb1c209d22e6fc9554f /src/utils
parent86300a0cd1f7197f9a4a61257c4616d49e573d87 (diff)
downloadjustbuild-53ba5581070bc8914a35a5e16af901c562923e61.tar.gz
fmt: Specialize formatter only for version >= 10
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/cpp/json.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/cpp/json.hpp b/src/utils/cpp/json.hpp
index 9fd2d66d..d83f30ed 100644
--- a/src/utils/cpp/json.hpp
+++ b/src/utils/cpp/json.hpp
@@ -21,6 +21,7 @@
#include <string>
#include <unordered_map>
+#include "fmt/core.h"
#include "fmt/ostream.h"
#include "gsl/gsl"
#include "nlohmann/json.hpp"
@@ -213,10 +214,12 @@ namespace detail {
return old_abbrev;
}
+#if defined(FMT_VERSION) and FMT_VERSION >= 100000
// Use nlohmann::basic_json::operator<<() for formatting via libfmt.
// This explicit template specialization seems to be required starting with
// libfmt 10.x.
template <>
struct fmt::formatter<nlohmann::basic_json<>> : ostream_formatter {};
+#endif
#endif // INCLUDED_SRC_UTILS_CPP_JSON_HPP