Skip to content
Snippets Groups Projects
Unverified Commit 9dde1421 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #496 from jcarpent/topic/devel

Fix compatibility issue on Windows for NumPy 2.x
parents 3586fcb4 61c1d93b
No related branches found
No related tags found
No related merge requests found
Pipeline #44480 passed with warnings
...@@ -4,7 +4,7 @@ channels: ...@@ -4,7 +4,7 @@ channels:
dependencies: dependencies:
- eigen - eigen
- cmake - cmake
- numpy<2.0 - numpy
- pkg-config - pkg-config
- boost - boost
- ccache - ccache
......
...@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ...@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add more general visitor `GenericMapPythonVisitor` for map types test `boost::unordered_map<std::string, int>` ([#504](https://github.com/stack-of-tasks/eigenpy/pull/504)) - Add more general visitor `GenericMapPythonVisitor` for map types test `boost::unordered_map<std::string, int>` ([#504](https://github.com/stack-of-tasks/eigenpy/pull/504))
- Support for non-[default-contructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible) types in map types ([#504](https://github.com/stack-of-tasks/eigenpy/pull/504)) - Support for non-[default-contructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible) types in map types ([#504](https://github.com/stack-of-tasks/eigenpy/pull/504))
- Add type_info helpers ([#502](https://github.com/stack-of-tasks/eigenpy/pull/502)) - Add type_info helpers ([#502](https://github.com/stack-of-tasks/eigenpy/pull/502))
- Add NumPy 2 support ([#496](https://github.com/stack-of-tasks/eigenpy/pull/496))
### Changed ### Changed
......
...@@ -5,12 +5,17 @@ ...@@ -5,12 +5,17 @@
#ifndef __eigenpy_numpy_hpp__ #ifndef __eigenpy_numpy_hpp__
#define __eigenpy_numpy_hpp__ #define __eigenpy_numpy_hpp__
#include "eigenpy/fwd.hpp" #include "eigenpy/config.hpp"
#ifndef PY_ARRAY_UNIQUE_SYMBOL #ifndef PY_ARRAY_UNIQUE_SYMBOL
#define PY_ARRAY_UNIQUE_SYMBOL EIGENPY_ARRAY_API #define PY_ARRAY_UNIQUE_SYMBOL EIGENPY_ARRAY_API
#endif #endif
// For compatibility with Numpy 2.x
// See
// https://numpy.org/devdocs/reference/c-api/array.html#c.NPY_API_SYMBOL_ATTRIBUTE
#define NPY_API_SYMBOL_ATTRIBUTE EIGENPY_DLLAPI
#include <numpy/numpyconfig.h> #include <numpy/numpyconfig.h>
#ifdef NPY_1_8_API_VERSION #ifdef NPY_1_8_API_VERSION
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
...@@ -50,6 +55,8 @@ static inline void _Py_SET_TYPE(PyObject* o, PyTypeObject* type) { ...@@ -50,6 +55,8 @@ static inline void _Py_SET_TYPE(PyObject* o, PyTypeObject* type) {
#define EIGENPY_GET_PY_ARRAY_TYPE(array) PyArray_MinScalarType(array)->type_num #define EIGENPY_GET_PY_ARRAY_TYPE(array) PyArray_MinScalarType(array)->type_num
#endif #endif
#include <complex>
namespace eigenpy { namespace eigenpy {
void EIGENPY_DLLAPI import_numpy(); void EIGENPY_DLLAPI import_numpy();
int EIGENPY_DLLAPI PyArray_TypeNum(PyTypeObject* type); int EIGENPY_DLLAPI PyArray_TypeNum(PyTypeObject* type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment