core: fix call to PyArray_Check

parent 4e82e8b5
......@@ -285,7 +285,7 @@ namespace eigenpy
template<typename MatType>
void* EigenFromPy<MatType>::convertible(PyArrayObject* pyArray)
{
if(!PyArray_Check(pyArray))
if(!call_PyArray_Check(pyArray))
return 0;
if(!np_type_is_convertible_into_scalar<Scalar>(EIGENPY_GET_PY_ARRAY_TYPE(pyArray)))
......@@ -476,7 +476,7 @@ namespace eigenpy
/// \brief Determine if pyObj can be converted into a MatType object
static void* convertible(PyArrayObject * pyArray)
{
if(!PyArray_Check(pyArray))
if(!call_PyArray_Check(pyArray))
return 0;
if(!PyArray_ISWRITEABLE(pyArray))
return 0;
......
......@@ -37,6 +37,8 @@ namespace eigenpy
#if defined _WIN32 || defined __CYGWIN__
namespace eigenpy
{
EIGENPY_DLLEXPORT bool call_PyArray_Check(PyObject *);
EIGENPY_DLLEXPORT PyObject* call_PyArray_SimpleNew(int nd, npy_intp * shape, int np_type);
EIGENPY_DLLEXPORT PyObject* call_PyArray_New(PyTypeObject * py_type_ptr, int nd, npy_intp * shape, int np_type, void * data_ptr, int options);
......@@ -52,6 +54,7 @@ namespace eigenpy
EIGENPY_DLLEXPORT int call_PyArray_RegisterDataType(PyArray_Descr * dtype);
}
#else
#define call_PyArray_Check(py_obj) PyArray_Check(py_obj)
#define call_PyArray_SimpleNew PyArray_SimpleNew
#define call_PyArray_New(py_type_ptr,nd,shape,np_type,data_ptr,options) \
PyArray_New(py_type_ptr,nd,shape,np_type,NULL,data_ptr,0,options,NULL)
......
......@@ -22,6 +22,11 @@ namespace eigenpy
#if defined _WIN32 || defined __CYGWIN__
bool call_PyArray_Check(PyObject * py_obj)
{
return PyArray_Check(py_obj);
}
PyObject* call_PyArray_SimpleNew(int nd, npy_intp * shape, int np_type)
{
return PyArray_SimpleNew(nd,shape,np_type);
......
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