diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-24 12:58:53 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-24 12:59:22 +0200 |
commit | 2c3cbe854f921068346ee78f7dda841116230ede (patch) | |
tree | acb00b4202ffaab3b565348a530f3ae0f919a555 /sources/shiboken2/libshiboken/pep384impl.h | |
parent | 0cf22cc9f74594252bd744d6aee77cd3ee3ae0e8 (diff) | |
parent | e24392c76e5cfdd2d6d51bd853b106db2bc4cb80 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ie90b31ed1b88f1353261fc4040db2d788df279e6
Diffstat (limited to 'sources/shiboken2/libshiboken/pep384impl.h')
-rw-r--r-- | sources/shiboken2/libshiboken/pep384impl.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h index 8f14c853a..643714f04 100644 --- a/sources/shiboken2/libshiboken/pep384impl.h +++ b/sources/shiboken2/libshiboken/pep384impl.h @@ -69,14 +69,9 @@ LIBSHIBOKEN_API void _PyObject_Dump(PyObject *); /* * There are a few structures that are needed, but cannot be used without * breaking the API. We use some heuristics to get those fields anyway - * and validate that we really found them, see Pepresolve.cpp . + * and validate that we really found them, see pep384impl.cpp . */ -// PepType is just a typecast that allows direct access. This is -// often better to read than the reversal via the former macro -// functions PepType_tp_xxx. -#define PepType(o) (reinterpret_cast<PepTypeObject*>(o)) - #ifdef Py_LIMITED_API /* @@ -87,7 +82,7 @@ LIBSHIBOKEN_API void _PyObject_Dump(PyObject *); * When we need more fields, we replace it back and add it to the * validation. */ -typedef struct _peptypeobject { +typedef struct _typeobject { PyVarObject ob_base; const char *tp_name; Py_ssize_t tp_basicsize; @@ -131,7 +126,7 @@ typedef struct _peptypeobject { PyObject *tp_bases; PyObject *tp_mro; /* method resolution order */ -} PepTypeObject; +} PyTypeObject; // This was a macro error in the limited API from the beginning. // It was fixed in Python master, but did make it only in Python 3.8 . @@ -143,11 +138,9 @@ LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj); #undef PyObject_IS_GC #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ - ( PepType(Py_TYPE(o))->tp_is_gc == NULL || \ - PepType(Py_TYPE(o))->tp_is_gc(o) )) + ( Py_TYPE(o)->tp_is_gc == NULL || \ + Py_TYPE(o)->tp_is_gc(o) )) -#else -#define PepTypeObject PyTypeObject #endif // Py_LIMITED_API struct SbkObjectTypePrivate; @@ -155,7 +148,7 @@ struct PySideQFlagsTypePrivate; struct _SbkGenericTypePrivate; #define PepHeapType_SIZE \ - (reinterpret_cast<PepTypeObject*>(&PyType_Type)->tp_basicsize) + (reinterpret_cast<PyTypeObject*>(&PyType_Type)->tp_basicsize) #define _genericTypeExtender(etype) \ (reinterpret_cast<char*>(etype) + PepHeapType_SIZE) |