![](https://secure.gravatar.com/avatar/ee5e5f5f5722dd7a9699b5e71870890f.jpg?s=120&d=mm&r=g)
Hi everyone, I have got code for some python wrappers of a scientific library which needs to support both Numpy 1.6 and later versions. The build of the wrapper (using swig) stopped working because of the deprecated API introduced in v1.7. The error only concerns the renaming of some macros from NPY_XXX to NPY_ARRAY_XXX. I was thinking to just check for the Numpy version at build time and add corresponding #define to provide the necessary renaming in case the build is done with Numpy v1.6. How can I robustly test for Numpy's version API in C ? Ghis
![](https://secure.gravatar.com/avatar/ee5e5f5f5722dd7a9699b5e71870890f.jpg?s=120&d=mm&r=g)
Would something like: #include "numpy/arrayobject.h" // for compatibility with Numpy version <= 1.6 #if NPY_FEATURE_VERSION < 0x00000007 #define NPY_ARRAY_FARRAY NPY_FARRAY // other defines for deprecated stuff // ... #endif Be robust enough ? 2014-02-28 14:31 GMT+00:00 Ghislain Vaillant <ghisvail@gmail.com>:
![](https://secure.gravatar.com/avatar/ee5e5f5f5722dd7a9699b5e71870890f.jpg?s=120&d=mm&r=g)
Would something like: #include "numpy/arrayobject.h" // for compatibility with Numpy version <= 1.6 #if NPY_FEATURE_VERSION < 0x00000007 #define NPY_ARRAY_FARRAY NPY_FARRAY // other defines for deprecated stuff // ... #endif Be robust enough ? 2014-02-28 14:31 GMT+00:00 Ghislain Vaillant <ghisvail@gmail.com>:
participants (1)
-
Ghislain Vaillant