aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/pep384impl.h
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2018-07-25 14:36:26 +0200
committerChristian Tismer <tismer@stackless.com>2018-08-06 21:20:40 +0000
commitb45d97ae4902fbae26f66e33526f868f32a503ce (patch)
tree8d2b0a53633d3240e5c1a320b844ac2427c09b55 /sources/shiboken2/libshiboken/pep384impl.h
parent83b42ca06c834ad07985397764ebe2d7a58234ce (diff)
Fix Some Minor Limited API Omissions And Quirks
Some formatting was not ok, some ordering of methods was not perfect, some code vanished, bufferprocs had a bad filename, and descrobject.h did not need a patch, anymore since things were solved in signature.cpp . Task-number: PYSIDE-560 Change-Id: Ibd1bedf0763ebb3fbbfd33a8e7cff4b5af6fab5e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/pep384impl.h')
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.h33
1 files changed, 10 insertions, 23 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
index 643714f04..d06947f06 100644
--- a/sources/shiboken2/libshiboken/pep384impl.h
+++ b/sources/shiboken2/libshiboken/pep384impl.h
@@ -53,7 +53,7 @@ extern "C"
// Extracted into bufferprocs27.h
#ifdef Py_LIMITED_API
-#include "bufferprocs27.h"
+#include "bufferprocs_py37.h"
#endif
/*****************************************************************************
@@ -136,11 +136,6 @@ typedef struct _typeobject {
LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj);
#endif
-#undef PyObject_IS_GC
-#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
- ( Py_TYPE(o)->tp_is_gc == NULL || \
- Py_TYPE(o)->tp_is_gc(o) ))
-
#endif // Py_LIMITED_API
struct SbkObjectTypePrivate;
@@ -148,22 +143,22 @@ struct PySideQFlagsTypePrivate;
struct _SbkGenericTypePrivate;
#define PepHeapType_SIZE \
- (reinterpret_cast<PyTypeObject*>(&PyType_Type)->tp_basicsize)
+ (reinterpret_cast<PyTypeObject *>(&PyType_Type)->tp_basicsize)
#define _genericTypeExtender(etype) \
- (reinterpret_cast<char*>(etype) + PepHeapType_SIZE)
+ (reinterpret_cast<char *>(etype) + PepHeapType_SIZE)
#define PepType_SOTP(etype) \
- (*reinterpret_cast<SbkObjectTypePrivate**>(_genericTypeExtender(etype)))
+ (*reinterpret_cast<SbkObjectTypePrivate **>(_genericTypeExtender(etype)))
#define PepType_SETP(etype) \
- (reinterpret_cast<SbkEnumTypePrivate*>(_genericTypeExtender(etype)))
+ (reinterpret_cast<SbkEnumTypePrivate *>(_genericTypeExtender(etype)))
#define PepType_PFTP(etype) \
- (reinterpret_cast<PySideQFlagsTypePrivate*>(_genericTypeExtender(etype)))
+ (reinterpret_cast<PySideQFlagsTypePrivate *>(_genericTypeExtender(etype)))
#define PepType_SGTP(etype) \
- (reinterpret_cast<_SbkGenericTypePrivate*>(_genericTypeExtender(etype)))
+ (reinterpret_cast<_SbkGenericTypePrivate *>(_genericTypeExtender(etype)))
// functions used everywhere
LIBSHIBOKEN_API const char *PepType_GetNameStr(PyTypeObject *type);
@@ -237,8 +232,8 @@ LIBSHIBOKEN_API char *_PepUnicode_AsString(PyObject *);
*/
#ifdef Py_LIMITED_API
#define PyTuple_GET_ITEM(op, i) PyTuple_GetItem((PyObject *)op, i)
-#define PyTuple_GET_SIZE(op) PyTuple_Size((PyObject *)op)
#define PyTuple_SET_ITEM(op, i, v) PyTuple_SetItem(op, i, v)
+#define PyTuple_GET_SIZE(op) PyTuple_Size((PyObject *)op)
#endif
/*****************************************************************************
@@ -272,15 +267,6 @@ typedef struct _pycfunc PyCFunctionObject;
/*****************************************************************************
*
- * RESOLVED: descrobject.h
- *
- */
-#ifdef Py_LIMITED_API
-typedef struct _methoddescr PyMethodDescrObject;
-#endif
-
-/*****************************************************************************
- *
* RESOLVED: pythonrun.h
*
*/
@@ -380,7 +366,8 @@ LIBSHIBOKEN_API PyObject *PyMethod_Self(PyObject *);
*/
#ifdef Py_LIMITED_API
/* Bytecode object */
- // we have to grab the code object from python
+
+// we have to grab the code object from python
typedef struct _code PyCodeObject;
LIBSHIBOKEN_API int PepCode_Get(PyCodeObject *co, const char *name);