8000 BUG: Fix build of third-party extensions with Py_LIMITED_API · numpy/numpy@53e4f63 · GitHub
[go: up one dir, main page]

Skip to content

Commit 53e4f63

Browse files
committed
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.
1 parent c6d95f5 commit 53e4f63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

numpy/core/include/numpy/ufuncobject.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ typedef struct _tagPyUFuncObject {
173173
* but this was never implemented. (This is also why the above
174174
* selector is called the "legacy" selector.)
175175
*/
176-
vectorcallfunc vectorcall;
176+
#ifndef Py_LIMITED_API
177+
vectorcallfunc vectorcall;
178+
#else
179+
void *reserved2;
180+
#endif
177181

178182
/* Was previously the `PyUFunc_MaskedInnerLoopSelectionFunc` */
179183
void *_always_null_previously_masked_innerloop_selector;

0 commit comments

Comments
 (0)
0