Skip to content

Commit 16d2cdd

Browse files
committed
BLD: add py_defines.h
1 parent 051c3ba commit 16d2cdd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pandas/src/ujson/python/py_defines.h

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <Python.h>
2+
3+
#if PY_MAJOR_VERSION >= 3
4+
#define PyIntObject PyLongObject
5+
#define PyInt_Type PyLong_Type
6+
#define PyInt_Check(op) PyLong_Check(op)
7+
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
8+
#define PyInt_FromString PyLong_FromString
9+
#define PyInt_FromUnicode PyLong_FromUnicode
10+
#define PyInt_FromLong PyLong_FromLong
11+
#define PyInt_FromSize_t PyLong_FromSize_t
12+
#define PyInt_FromSsize_t PyLong_FromSsize_t
13+
#define PyInt_AsLong PyLong_AsLong
14+
#define PyInt_AS_LONG PyLong_AS_LONG
15+
#define PyInt_AsSsize_t PyLong_AsSsize_t
16+
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
17+
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
18+
19+
#define PyString_Check PyUnicode_Check
20+
#define PyString_GET_SIZE PyBytes_GET_SIZE
21+
#define PyString_AS_STRING PyBytes_AS_STRING
22+
#define PyString_FromString PyUnicode_FromString
23+
24+
#endif

0 commit comments

Comments
 (0)