From 4a32f9d00b043b7255b590b95e9b35e9de44c4ed Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Mon, 25 Jun 2018 15:24:11 +0200 Subject: Prepare Limited API for Python 3.7 PySide has successfully been tested with the Python 3.7 branch. There will be no change in the areas that are important for us. It is then safe to bump the supported version and the limited API version checks to fully include Python 3.7. The macro errors in the limited API was fixed by a pull request, but it was too late to get it into 3.7rc1. The error workaround was therefore extracted into pep384_issue33738.cpp and will be deactivated later. Change-Id: Iec3f277b02cac03a5cf44cbcf955ddc690c112e5 Reviewed-by: Friedemann Kleint --- sources/shiboken2/libshiboken/pep384impl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sources/shiboken2/libshiboken/pep384impl.h') diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h index 69e984816..bfc603f69 100644 --- a/sources/shiboken2/libshiboken/pep384impl.h +++ b/sources/shiboken2/libshiboken/pep384impl.h @@ -133,11 +133,14 @@ typedef struct _peptypeobject { } PepTypeObject; -LIBSHIBOKEN_API unaryfunc PepType_nb_index(PyTypeObject *type); - +// This was a macro error in the limited API from the beginning. +// It was fixed in Python 3.7 . +// XXX The commit did go to master, but did not make it to 3.7, yet. +//#if PY_VERSION_HEX < 0x03070000 +#if PY_VERSION_HEX < 0x03080000 #undef PyIndex_Check - LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj); +#endif #undef PyObject_IS_GC #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ @@ -146,7 +149,6 @@ LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj); #else #define PepTypeObject PyTypeObject -#define PepType_nb_index(o) (PepType(o)->nb_index) #endif // Py_LIMITED_API struct SbkObjectTypePrivate; @@ -309,7 +311,7 @@ typedef struct _methoddescr PyMethodDescrObject; #ifdef Py_LIMITED_API #define Py_TRASH_MIN_COMPATIBLE 0x03020400 -#define Py_TRASH_MAX_COMPATIBLE 0x030700A0 +#define Py_TRASH_MAX_COMPATIBLE 0x0307FFFF #if PY_VERSION_HEX >= Py_TRASH_MIN_COMPATIBLE && \ PY_VERSION_HEX <= Py_TRASH_MAX_COMPATIBLE @@ -383,7 +385,7 @@ LIBSHIBOKEN_API PyObject *PyRun_String(const char *, int, PyObject *, PyObject * // But this is no problem as we check it's validity for every version. #define PYTHON_BUFFER_VERSION_COMPATIBLE (PY_VERSION_HEX >= 0x03030000 && \ - PY_VERSION_HEX < 0X0306FFFF) + PY_VERSION_HEX < 0X0307FFFF) #if !PYTHON_BUFFER_VERSION_COMPATIBLE # error Please check the buffer compatibility for this python version! #endif -- cgit v1.2.3