diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fbb059ea27a24daf30f0e4f4fc061f97ffffebc..686116d34f7ff4def20ead31a99c38851d6493a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Remove CMake CMP0167 warnings ([#487](https://github.com/stack-of-tasks/eigenpy/pull/487)) +- Fix compilation error on armhf ([#488](https://github.com/stack-of-tasks/eigenpy/pull/488)) ## [3.7.0] - 2024-06-11 diff --git a/include/eigenpy/numpy.hpp b/include/eigenpy/numpy.hpp index 3786b091b9ff1b36e604d69be0011c01f7082a2d..1d7b68f7bb987424493239b574386e70b4d772ee 100644 --- a/include/eigenpy/numpy.hpp +++ b/include/eigenpy/numpy.hpp @@ -55,7 +55,7 @@ void EIGENPY_DLLAPI import_numpy(); int EIGENPY_DLLAPI PyArray_TypeNum(PyTypeObject* type); // By default, the Scalar is considered as a Python object -template <typename Scalar> +template <typename Scalar, typename Enable = void> struct NumpyEquivalentType { enum { type_code = NPY_USERDEF }; }; @@ -139,12 +139,19 @@ struct NumpyEquivalentType<unsigned long> { // See https://github.com/stack-of-tasks/eigenpy/pull/455 #if defined __linux__ -template <> -struct NumpyEquivalentType<long long> { +#include <type_traits> + +template <typename Scalar> +struct NumpyEquivalentType< + Scalar, std::enable_if_t<!std::is_same<int64_t, long long>::value && + std::is_same<Scalar, long long>::value> > { enum { type_code = NPY_LONGLONG }; }; -template <> -struct NumpyEquivalentType<unsigned long long> { +template <typename Scalar> +struct NumpyEquivalentType< + Scalar, + std::enable_if_t<!std::is_same<uint64_t, unsigned long long>::value && + std::is_same<Scalar, unsigned long long>::value> > { enum { type_code = NPY_ULONGLONG }; };