aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dan Miller <dnmiller@gmail.com>2021-07-01 14:54:12 +0000
committerGravatar Antonio Sánchez <cantonios@google.com>2021-07-01 14:54:12 +0000
commiteb047759030558acf0764d5d2f913f4f84cf85a8 (patch)
tree6fa9c0caf2e408e40bb73dd4f4496209c1035141
parent91e99ec1e02100d07e35a7abb1b5c76707237219 (diff)
Fix duplicate definitions on Mac
-rwxr-xr-xEigen/src/Core/util/Meta.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index b6aaed138..2429ddad2 100755
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -189,19 +189,17 @@ template<> struct make_unsigned<signed int> { typedef unsigned int type; }
template<> struct make_unsigned<unsigned int> { typedef unsigned int type; };
template<> struct make_unsigned<signed long> { typedef unsigned long type; };
template<> struct make_unsigned<unsigned long> { typedef unsigned long type; };
-template<> struct make_unsigned<signed long long> { typedef unsigned long long type; };
-template<> struct make_unsigned<unsigned long long> { typedef unsigned long long type; };
#if EIGEN_COMP_MSVC
template<> struct make_unsigned<signed __int64> { typedef unsigned __int64 type; };
template<> struct make_unsigned<unsigned __int64> { typedef unsigned __int64 type; };
#endif
-// 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
+// Some platforms define int64_t as `long long` even for C++03, where
+// `long long` is not guaranteed by the standard. In this case we are missing
+// the definition for make_unsigned. If we just define it, we run into issues
+// where `long long` doesn't exist in some compilers for C++03. We therefore add
+// the specialization for these platforms only.
+#if EIGEN_OS_MAC || EIGEN_COMP_MINGW
template<> struct make_unsigned<unsigned long long> { typedef unsigned long long type; };
template<> struct make_unsigned<long long> { typedef unsigned long long type; };
#endif