aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Meta.h
diff options
context:
space:
mode:
authorGravatar David Tellenbach <david.tellenbach@me.com>2021-02-17 23:03:10 +0100
committerGravatar David Tellenbach <david.tellenbach@me.com>2021-02-17 23:03:10 +0100
commit5336ad8591412184cb1a026d72278f3711f49ed4 (patch)
tree4cf17bea0b2be19996e33567603acd1386ba9459 /Eigen/src/Core/util/Meta.h
parent0845df7f77c50bd8a99fbf6b943976a6ab6c38ec (diff)
Define internal::make_unsigned for [unsigned]long long on macOS.
macOS defines int64_t as long long even for C++03 and therefore expects a template specialization internal::make_unsigned<long long>, for C++03. Since other platforms define int64_t as long for C++03 we cannot add the specialization for all cases.
Diffstat (limited to 'Eigen/src/Core/util/Meta.h')
-rwxr-xr-xEigen/src/Core/util/Meta.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index ab1bc01da..32a03aecc 100755
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -194,9 +194,15 @@ template<> struct make_unsigned<signed __int64> { typedef unsigned __int64 typ
template<> struct make_unsigned<unsigned __int64> { typedef unsigned __int64 type; };
#endif
-// TODO: Some platforms define int64_t as long long even for C++03. In this case
-// we are missing the definition for make_unsigned. If we just define it, we get
-// duplicated definitions for platforms defining int64_t as signed long for C++03
+// Some platforms define int64_t as long long even for C++03. In this case we
+// are missing the definition for make_unsigned. If we just define it, we get
+// duplicated definitions for platforms defining int64_t as signed long for
+// C++03. We therefore add the specialization for C++03 long long for these
+// platforms only.
+#if EIGEN_OS_MAC
+template<> struct make_unsigned<unsigned long long> { typedef unsigned long long type; };
+template<> struct make_unsigned<long long> { typedef unsigned long long type; };
+#endif
#endif
template <typename T> struct add_const { typedef const T type; };