summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Singer <leo.singer@ligo.org>2022-01-13 13:19:31 -0500
committerLeo Singer <leo.singer@ligo.org>2022-01-13 18:55:02 -0500
commit8b70732e81602f64b31fb2a3b25c9741ce0d2886 (patch)
treea94a79c6a8039dc83b914d90b16ac9e217ec2287
parentc6d95f57bff1ae390b3539bd46f1c74695b861eb (diff)
downloadnumpy-8b70732e81602f64b31fb2a3b25c9741ce0d2886.tar.gz
BUG: Fix build of third-party extensions with Py_LIMITED_API
The type `vectorcallfunc` is not defined by Python's limited API. Guard its use with a `#ifdef` so that third-party extensions that use the Numpy C API will build with Py_LIMITED_API defined. This fixes a regression introduced in #20315.
-rw-r--r--numpy/core/include/numpy/ufuncobject.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index 1d7050bbe..bb0633100 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -173,7 +173,11 @@ typedef struct _tagPyUFuncObject {
* but this was never implemented. (This is also why the above
* selector is called the "legacy" selector.)
*/
- vectorcallfunc vectorcall;
+ #ifndef Py_LIMITED_API
+ vectorcallfunc vectorcall;
+ #else
+ void *vectorcall;
+ #endif
/* Was previously the `PyUFunc_MaskedInnerLoopSelectionFunc` */
void *_always_null_previously_masked_innerloop_selector;