Skip to content

Commit cedc9dc

Browse files
committed
Add pandas patch: Remove usage of cstdlib in window.cpp
1 parent bfc478e commit cedc9dc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,22 @@ def pandas(**kwargs):
995995
- #include <cstdlib>
996996
- #define __Pyx_sst_abs(value) std::abs(value)
997997
-#elif SIZEOF_INT >= SIZEOF_SIZE_T
998+
+#if SIZEOF_INT >= SIZEOF_SIZE_T
999+
#define __Pyx_sst_abs(value) abs(value)
1000+
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1001+
#define __Pyx_sst_abs(value) labs(value)
1002+
diff --git a/pandas/_libs/window.cpp b/pandas/_libs/window.cpp
1003+
index d527af6..773cfe0 100644
1004+
--- a/pandas/_libs/window.cpp
1005+
+++ b/pandas/_libs/window.cpp
1006+
@@ -705,10 +705,7 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
1007+
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1008+
return (size_t) i < (size_t) limit;
1009+
}
1010+
-#if defined (__cplusplus) && __cplusplus >= 201103L
1011+
- #include <cstdlib>
1012+
- #define __Pyx_sst_abs(value) std::abs(value)
1013+
-#elif SIZEOF_INT >= SIZEOF_SIZE_T
9981014
+#if SIZEOF_INT >= SIZEOF_SIZE_T
9991015
#define __Pyx_sst_abs(value) abs(value)
10001016
#elif SIZEOF_LONG >= SIZEOF_SIZE_T

0 commit comments

Comments
 (0)