File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030/* NumPy 1.x/2.x compatibility macros */
3131/******************************************************************************/
3232
33- #include <numpy/npy_common.h>
34-
35- #if NPY_ABI_VERSION < 0x02000000
33+ /* Check for NumPy 2.x using NPY_ABI_VERSION if available, otherwise assume 1.x */
34+ #if defined(NPY_ABI_VERSION ) && NPY_ABI_VERSION >= 0x02000000
35+ /* NumPy 2.x: macros are provided by NumPy headers */
36+ #else
37+ /* NumPy 1.x: define compatibility macros */
3638 #define PyDataType_ELSIZE (d ) ((d)->elsize)
3739 #define PyDataType_TYPE_NUM (d ) ((d)->type_num)
3840#endif
Original file line number Diff line number Diff line change 3131/* NumPy 1.x/2.x compatibility macros */
3232/******************************************************************************/
3333
34- #include <numpy/npy_common.h>
35-
36- #if NPY_ABI_VERSION < 0x02000000
34+ /* Check for NumPy 2.x using NPY_ABI_VERSION if available, otherwise assume 1.x */
35+ #if defined(NPY_ABI_VERSION ) && NPY_ABI_VERSION >= 0x02000000
36+ /* NumPy 2.x: macros are provided by NumPy headers */
37+ #else
38+ /* NumPy 1.x: define compatibility macros */
3739 #define PyDataType_ELSIZE (d ) ((d)->elsize)
3840 #define PyDataType_TYPE_NUM (d ) ((d)->type_num)
3941#endif
You can’t perform that action at this time.
0 commit comments