summaryrefslogtreecommitdiff
blob: 422a507a6d86ba1d4803e05d31639896c9a6bdb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
https://github.com/gabime/spdlog/pull/1606

From 22bee8128a4150ce37cf761ed9a609ad891848a6 Mon Sep 17 00:00:00 2001
From: Craig Andrews <candrews@integralblue.com>
Date: Mon, 6 Jul 2020 13:01:52 -0400
Subject: [PATCH] fmt 7.0.0 renamed the internal namespace to detail.

See: https://github.com/fmtlib/fmt/issues/1538
---
 include/spdlog/details/fmt_helper.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/spdlog/details/fmt_helper.h b/include/spdlog/details/fmt_helper.h
index cbc0bdf3..4f363858 100644
--- a/include/spdlog/details/fmt_helper.h
+++ b/include/spdlog/details/fmt_helper.h
@@ -34,7 +34,15 @@ template<typename T>
 inline unsigned int count_digits(T n)
 {
     using count_type = typename std::conditional<(sizeof(T) > sizeof(uint32_t)), uint64_t, uint32_t>::type;
-    return static_cast<unsigned int>(fmt::internal::count_digits(static_cast<count_type>(n)));
+    return static_cast<unsigned int>(fmt::
+// fmt 7.0.0 renamed the internal namespace to detail.
+// See: https://github.com/fmtlib/fmt/issues/1538
+#if FMT_VERSION < 70000
+internal
+#else
+detail
+#endif
+::count_digits(static_cast<count_type>(n)));
 }
 
 inline void pad2(int n, memory_buf_t &dest)