Unverified Commit a7248345 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub

Merge pull request #203 from jcarpent/devel

Fix compilation issues with NumPy 1.19
parents cbbaad1a 5c8eb86b
Subproject commit 89bd42923644d96fbe99d7495d12021d1e885a83
Subproject commit 1498ee681d9f6b83ffd231978279fe94a2fa1c25
......@@ -12,9 +12,15 @@ namespace eigenpy
namespace internal
{
#ifdef NPY_1_19_API_VERSION
#define EIGENPY_NPY_CONST_UFUNC_ARG const
#else
#define EIGENPY_NPY_CONST_UFUNC_ARG
#endif
#define EIGENPY_REGISTER_BINARY_OPERATOR(name,op) \
template<typename T1, typename T2, typename R> \
void binary_op_##name(char** args, npy_intp * dimensions, npy_intp * steps, void * /*data*/) \
void binary_op_##name(char** args, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * steps, void * /*data*/) \
{ \
npy_intp is0 = steps[0], is1 = steps[1], \
os = steps[2], n = *dimensions; \
......@@ -31,7 +37,7 @@ namespace eigenpy
} \
\
template<typename T> \
void binary_op_##name(char** args, npy_intp * dimensions, npy_intp * steps, void * data) \
void binary_op_##name(char** args, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * steps, void * data) \
{ \
binary_op_##name<T,T,T>(args,dimensions,steps,data); \
}
......@@ -49,7 +55,7 @@ namespace eigenpy
#define EIGENPY_REGISTER_UNARY_OPERATOR(name,op) \
template<typename T, typename R> \
void unary_op_##name(char** args, npy_intp * dimensions, npy_intp * steps, void * /*data*/) \
void unary_op_##name(char** args, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * steps, void * /*data*/) \
{ \
npy_intp is = steps[0], \
os = steps[1], n = *dimensions; \
......@@ -65,7 +71,7 @@ namespace eigenpy
} \
\
template<typename T> \
void unary_op_##name(char** args, npy_intp * dimensions, npy_intp * steps, void * data) \
void unary_op_##name(char** args, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * steps, void * data) \
{ \
unary_op_##name<T,T>(args,dimensions,steps,data); \
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment