@@ -21,6 +21,12 @@ pub struct PyArrayObject {
2121 pub descr : * mut PyArray_Descr ,
2222 pub flags : c_int ,
2323 pub weakreflist : * mut PyObject ,
24+
25+ #[ cfg( Numpy_1_20 ) ]
26+ pub _buffer_info : * mut c_void ,
27+
28+ #[ cfg( Numpy_1_22 ) ]
29+ pub mem_handler : * mut PyObject ,
2430}
2531
2632#[ repr( C ) ]
@@ -32,6 +38,19 @@ pub struct PyArray_Descr {
3238 pub byteorder : c_char ,
3339 pub _former_flags : c_char ,
3440 pub type_num : c_int ,
41+
42+ #[ cfg( Numpy_2_0 ) ]
43+ pub flags : npy_uint64 ,
44+ #[ cfg( Numpy_2_0 ) ]
45+ pub elsize : npy_intp ,
46+ #[ cfg( Numpy_2_0 ) ]
47+ pub alignment : npy_intp ,
48+ #[ cfg( Numpy_2_0 ) ]
49+ pub metadata : * mut PyObject ,
50+ #[ cfg( Numpy_2_0 ) ]
51+ pub hash : npy_hash_t ,
52+ #[ cfg( Numpy_2_0 ) ]
53+ pub reserved_null : [ * mut c_void ; 2 ] ,
3554}
3655
3756#[ repr( C ) ]
@@ -365,11 +384,31 @@ pub struct PyUFuncObject {
365384 pub core_offsets : * mut c_int ,
366385 pub core_signature : * mut c_char ,
367386 pub type_resolver : PyUFunc_TypeResolutionFunc ,
368- pub legacy_inner_loop_selector : PyUFunc_LegacyInnerLoopSelectionFunc ,
369- pub reserved2 : * mut c_void ,
370- pub masked_inner_loop_selector : PyUFunc_MaskedInnerLoopSelectionFunc ,
387+ pub dict : * mut PyObject ,
388+
389+ #[ cfg( all( Py_3_8 , not( Py_LIMITED_API ) ) ) ]
390+ pub vectorcall : Option < vectorcallfunc > ,
391+ #[ cfg( not( all( Py_3_8 , not( Py_LIMITED_API ) ) ) ) ]
392+ pub vectorcall : * mut c_void ,
393+
394+ pub reserved3 : * mut c_void ,
371395 pub op_flags : * mut npy_uint32 ,
372396 pub iter_flags : npy_uint32 ,
397+
398+ #[ cfg( Numpy_1_16 ) ]
399+ pub core_dim_sizes : * mut npy_intp ,
400+ #[ cfg( Numpy_1_16 ) ]
401+ pub core_dim_flags : * mut npy_uint32 ,
402+ #[ cfg( Numpy_1_16 ) ]
403+ pub identity_value : * mut PyObject ,
404+
405+ #[ cfg( Numpy_1_22 ) ]
406+ pub _dispatch_cache : * mut c_void ,
407+ #[ cfg( Numpy_1_22 ) ]
408+ pub _loops : * mut PyObject ,
409+
410+ #[ cfg( Numpy_2_1 ) ]
411+ pub process_core_dims_func : PyUFunc_ProcessCoreDimsFunc ,
373412}
374413
375414pub type PyUFuncGenericFunction =
@@ -415,6 +454,10 @@ pub type PyUFunc_MaskedInnerLoopSelectionFunc = Option<
415454 ) -> c_int ,
416455> ;
417456
457+ #[ cfg( Numpy_2_1 ) ]
458+ pub type PyUFunc_ProcessCoreDimsFunc =
459+ Option < unsafe extern "C" fn ( * mut PyUFuncObject , * mut npy_intp ) -> c_int > ;
460+
418461#[ repr( C ) ]
419462#[ derive( Debug , Copy , Clone ) ]
420463pub struct NpyIter ( [ u8 ; 0 ] ) ;
0 commit comments