From eb047759030558acf0764d5d2f913f4f84cf85a8 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 1 Jul 2021 14:54:12 +0000 Subject: Fix duplicate definitions on Mac --- Eigen/src/Core/util/Meta.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Eigen/src/Core/util/Meta.h') 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 { typedef unsigned int type; } template<> struct make_unsigned { typedef unsigned int type; }; template<> struct make_unsigned { typedef unsigned long type; }; template<> struct make_unsigned { typedef unsigned long type; }; -template<> struct make_unsigned { typedef unsigned long long type; }; -template<> struct make_unsigned { typedef unsigned long long type; }; #if EIGEN_COMP_MSVC template<> struct make_unsigned { typedef unsigned __int64 type; }; template<> struct make_unsigned { 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 { typedef unsigned long long type; }; template<> struct make_unsigned { typedef unsigned long long type; }; #endif -- cgit v1.2.3