summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/include/numpy/ufuncobject.h6
-rw-r--r--numpy/core/src/umath/ufunc_object.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index a191e5766..7fe5e9f82 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -130,8 +130,8 @@ typedef struct _tagPyUFuncObject {
/* The number of elements in 'functions' and 'data' */
int ntypes;
- /* Used to be unused field 'check_return' */
- int reserved1;
+ /* Used to be unused field 'check_return', repurposed in 1.16 */
+ int version;
/* The name of the ufunc */
const char *name;
@@ -210,6 +210,8 @@ typedef struct _tagPyUFuncObject {
*/
npy_uint32 iter_flags;
+ /* New in version 1 and above */
+
/*
* sizes of frozen core dimensions, or -1 if unset
*/
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 47a4d876b..e7031557e 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -4654,7 +4654,7 @@ PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data,
}
PyObject_Init((PyObject *)ufunc, &PyUFunc_Type);
- ufunc->reserved1 = 0;
+ ufunc->version = 1; /* NumPy 1.16 and up */
ufunc->reserved2 = NULL;
ufunc->nin = nin;