Skip to content

Commit 94dc0ca

Browse files
committed
Add patch for Pandas to not use header 'cstdlib'.
1 parent 2908c21 commit 94dc0ca

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,39 @@ def pandas(*args):
376376
377377
dinfo->abstime = (double)(hour * 3600 + minute * 60) + second;
378378
379+
diff --git a/pandas/io/msgpack/_packer.cpp b/pandas/io/msgpack/_packer.cpp
380+
index 8b5b382..7544707 100644
381+
--- a/pandas/io/msgpack/_packer.cpp
382+
+++ b/pandas/io/msgpack/_packer.cpp
383+
@@ -477,10 +477,7 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
384+
(sizeof(type) == sizeof(Py_ssize_t) &&\\
385+
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\\
386+
v == (type)PY_SSIZE_T_MAX))) )
387+
-#if defined (__cplusplus) && __cplusplus >= 201103L
388+
- #include <cstdlib>
389+
- #define __Pyx_sst_abs(value) std::abs(value)
390+
-#elif SIZEOF_INT >= SIZEOF_SIZE_T
391+
+#if SIZEOF_INT >= SIZEOF_SIZE_T
392+
#define __Pyx_sst_abs(value) abs(value)
393+
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
394+
#define __Pyx_sst_abs(value) labs(value)
395+
diff --git a/pandas/io/msgpack/_unpacker.cpp b/pandas/io/msgpack/_unpacker.cpp
396+
index fa08f53..49f3bf3 100644
397+
--- a/pandas/io/msgpack/_unpacker.cpp
398+
+++ b/pandas/io/msgpack/_unpacker.cpp
399+
@@ -477,10 +477,7 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
400+
(sizeof(type) == sizeof(Py_ssize_t) &&\\
401+
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\\
402+
v == (type)PY_SSIZE_T_MAX))) )
403+
-#if defined (__cplusplus) && __cplusplus >= 201103L
404+
- #include <cstdlib>
405+
- #define __Pyx_sst_abs(value) std::abs(value)
406+
-#elif SIZEOF_INT >= SIZEOF_SIZE_T
407+
+#if SIZEOF_INT >= SIZEOF_SIZE_T
408+
#define __Pyx_sst_abs(value) abs(value)
409+
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
410+
#define __Pyx_sst_abs(value) labs(value)
411+
379412
"""
380413
cflags = "-allowcpp" if sys.implementation.name == "graalpython" else ""
381414
install_from_url("https://files.pythonhosted.org/packages/ee/aa/90c06f249cf4408fa75135ad0df7d64c09cf74c9870733862491ed5f3a50/pandas-0.20.3.tar.gz", patch=patch, extra_opts=args, add_cflags=cflags)

0 commit comments

Comments
 (0)