summaryrefslogtreecommitdiff
path: root/numpy/f2py/src
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2022-06-17 08:09:59 +0200
committerRalf Gommers <ralf.gommers@gmail.com>2022-06-17 08:12:05 +0200
commitc4694b4cb23c986bf71ae22a47bdf3c5f192922b (patch)
tree758d1eb5aa3d1c129082714da1d65e52c630c965 /numpy/f2py/src
parenta065bf62d9f726df94424aaa2e46092f9c88688c (diff)
downloadnumpy-c4694b4cb23c986bf71ae22a47bdf3c5f192922b.tar.gz
MAINT: fix up use of `NPY_NO_DEPRECATED_API` usage in f2py
This was giving a lot of warnings like: numpy/f2py/src/fortranobject.h:9: warning: "NPY_NO_DEPRECATED_API" redefined when building SciPy. In general, this is generated code which is included in the build of other projects which may have already set this macro - so only set it if it is not yet set. The other change is to set it to the current numpy version, like is done everywhere else in numpy, rather than to a fixed 1.7 version. This will ensure that if new deprecations happen, f2py gets updated for them.
Diffstat (limited to 'numpy/f2py/src')
-rw-r--r--numpy/f2py/src/fortranobject.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index 376b83dad..abd699c2f 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -6,7 +6,9 @@ extern "C" {
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#ifndef NPY_NO_DEPRECATED_API
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#endif
#ifdef FORTRANOBJECT_C
#define NO_IMPORT_ARRAY
#endif