From 2c12261d3d312d9bff2738f39bfc7fece26f91a7 Mon Sep 17 00:00:00 2001 From: Justin Carpentier <justin.carpentier@inria.fr> Date: Fri, 26 Jan 2024 14:58:24 +0100 Subject: [PATCH] core: fix support of int32 and int64 support on Windows platforms --- include/eigenpy/numpy-type.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/eigenpy/numpy-type.hpp b/include/eigenpy/numpy-type.hpp index a5d12aef..319fd2ab 100644 --- a/include/eigenpy/numpy-type.hpp +++ b/include/eigenpy/numpy-type.hpp @@ -24,14 +24,20 @@ bool np_type_is_convertible_into_scalar(const int np_type) { if (NumpyEquivalentType<Scalar>::type_code == np_type) return true; switch (np_type) { +#ifdef WIN32 case NPY_INT: + case NPY_LONG: return FromTypeToType<int, Scalar>::value; -#ifdef WIN32 case NPY_INT64: + case NPY_LONGLONG: return FromTypeToType<__int64, Scalar>::value; -#endif +#else + case NPY_INT: + return FromTypeToType<int, Scalar>::value; case NPY_LONG: + case NPY_LONGLONG: return FromTypeToType<long, Scalar>::value; +#endif case NPY_FLOAT: return FromTypeToType<float, Scalar>::value; case NPY_CFLOAT: -- GitLab