File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 4343 * and `PyArray_MultiIter_DIMS`.
4444 */
4545
46+ #define WORKAROUND_NEEDED (defined(NPY_2_0_API_VERSION) && (NPY_API_VERSION >= NPY_2_0_API_VERSION))
47+
48+ #if !WORKAROUND_NEEDED
4649typedef struct {
4750 PyObject_HEAD
4851 int numiter ;
@@ -52,27 +55,28 @@ typedef struct {
5255 npy_intp dimensions [32 ];
5356 void * * iters ;
5457} multi_iter_proxy_st ;
58+ #endif
5559
5660npy_intp workaround_PyArray_MultiIter_SIZE (PyArrayMultiIterObject * multi ) {
57- #if defined( NPY_2_0_API_VERSION ) && ( NPY_API_VERSION >= NPY_2_0_API_VERSION )
61+ #if WORKAROUND_NEEDED
5862 return PyArray_MultiIter_SIZE (multi );
5963#else
6064 return ((multi_iter_proxy_st * )(multi ))-> size ;
6165#endif
6266}
6367
6468int workaround_PyArray_MultiIter_NDIM (PyArrayMultiIterObject * multi ) {
65- #if defined( NPY_2_0_API_VERSION ) && ( NPY_API_VERSION >= NPY_2_0_API_VERSION )
69+ #if WORKAROUND_NEEDED
6670 return PyArray_MultiIter_NDIM (multi );
6771#else
6872 return ((multi_iter_proxy_st * )(multi ))-> nd ;
6973#endif
7074}
7175
7276npy_intp * workaround_PyArray_MultiIter_DIMS (PyArrayMultiIterObject * multi ) {
73- #if defined( NPY_2_0_API_VERSION ) && ( NPY_API_VERSION >= NPY_2_0_API_VERSION )
77+ #if WORKAROUND_NEEDED
7478 return PyArray_MultiIter_DIMS (multi );
7579#else
7680 return (((multi_iter_proxy_st * )(multi ))-> dimensions );
7781#endif
78- }
82+ }
You can’t perform that action at this time.
0 commit comments