File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
numpy/_core/include/numpy Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 32
32
33
33
/*
34
34
* Allow users to use `PyArray_RUNTIME_VERSION` when vendoring the file for
35
- * compilation with NumPy 1.x
35
+ * compilation with NumPy 1.x.
36
+ * Simply do not define when compiling with 2.x. It must be defined later
37
+ * as it is set during `import_array()`.
36
38
*/
37
- #ifndef PyArray_RUNTIME_VERSION
38
- /* IF we are compiling with NumPy 2, something is wrong: */
39
- #if NPY_ABI_VERSION >= 0x02000000
40
- #error "PyArray_RUNTIME_VERSION not defined, but `npy_2_compat.h` included"
41
- #endif
42
- /* Just hardcode it to the NPY_FEATURE_VERSION */
39
+ #if !defined(PyArray_RUNTIME_VERSION ) && NPY_ABI_VERSION < 0x02000000
40
+ /*
41
+ * If we are compiling with NumPy 1.x, PyArray_RUNTIME_VERSION so we
42
+ * pretend the `PyArray_RUNTIME_VERSION` is `NPY_FEATURE_VERSION`.
43
+ */
43
44
#define PyArray_RUNTIME_VERSION NPY_FEATURE_VERSION
44
45
#endif
45
46
You can’t perform that action at this time.
0 commit comments