From 5336ad8591412184cb1a026d72278f3711f49ed4 Mon Sep 17 00:00:00 2001 From: David Tellenbach Date: Wed, 17 Feb 2021 23:03:10 +0100 Subject: 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, for C++03. Since other platforms define int64_t as long for C++03 we cannot add the specialization for all cases. --- Eigen/src/Core/util/Meta.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Eigen/src/Core/util') 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 { typedef unsigned __int64 typ template<> struct make_unsigned { 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 { typedef unsigned long long type; }; +template<> struct make_unsigned { typedef unsigned long long type; }; +#endif #endif template struct add_const { typedef const T type; }; -- cgit v1.2.3