Skip to content

Commit 9b5a451

Browse files
Merge pull request #485 from seberg/allow-numpy-1-builds
MAINT: Allow building with NumPy 1.x locally
2 parents 1e47e47 + b35f5fc commit 9b5a451

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numexpr/interpreter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
#define AVAILABLE(Haystack, Haystack_Len, J, Needle_Len) \
4848
((Haystack_Len) >= (J) + (Needle_Len))
4949

50+
// To allow building with NumPy<2 locally define the new NumPy macros:
51+
#if NPY_ABI_VERSION < 0x02000000
52+
#define PyDataType_ELSIZE(descr) ((descr)->elsize)
53+
#define PyDataType_SET_ELSIZE(descr, size) (descr)->elsize = size
54+
#endif
55+
5056
#include "str-two-way.hpp"
5157

5258
#ifdef DEBUG

0 commit comments

Comments
 (0)