diff options
author | David Tellenbach <david.tellenbach@me.com> | 2021-02-17 23:03:10 +0100 |
---|---|---|
committer | David Tellenbach <david.tellenbach@me.com> | 2021-02-17 23:03:10 +0100 |
commit | 5336ad8591412184cb1a026d72278f3711f49ed4 (patch) | |
tree | 4cf17bea0b2be19996e33567603acd1386ba9459 /Eigen/src/Core/util/Meta.h | |
parent | 0845df7f77c50bd8a99fbf6b943976a6ab6c38ec (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-x | Eigen/src/Core/util/Meta.h | 12 |
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; }; |