aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkenum.h
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2017-12-17 19:12:56 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-05-30 18:13:41 +0000
commit18dc31becdd994c53a9f894087cf1ef99fbd0232 (patch)
tree3021cfa473f20102bfb63a26117776615b91b526 /sources/shiboken2/libshiboken/sbkenum.h
parent50dd4ae202d7afb3556335c056db003f5ef50532 (diff)
PEP 384-squash: Implement PEP 384
This is the condensed checkin of 18 commits which created the implementation of PEP 384. Task-number: PYSIDE-560 Change-Id: I834c659af4c2b55b268f8e8dc4cfa53f02502409 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkenum.h')
-rw-r--r--sources/shiboken2/libshiboken/sbkenum.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/sources/shiboken2/libshiboken/sbkenum.h b/sources/shiboken2/libshiboken/sbkenum.h
index 4e466542..c1ec7c4c 100644
--- a/sources/shiboken2/libshiboken/sbkenum.h
+++ b/sources/shiboken2/libshiboken/sbkenum.h
@@ -46,9 +46,11 @@
extern "C"
{
-extern LIBSHIBOKEN_API PyTypeObject SbkEnumType_Type;
+extern LIBSHIBOKEN_API PyTypeObject *SbkEnumType_TypeF(void);
struct SbkObjectType;
struct SbkConverter;
+struct SbkEnumType;
+struct SbkEnumTypePrivate;
} // extern "C"
@@ -57,7 +59,7 @@ namespace Shiboken
inline bool isShibokenEnum(PyObject* pyObj)
{
- return Py_TYPE(pyObj->ob_type) == &SbkEnumType_Type;
+ return Py_TYPE(Py_TYPE(pyObj)) == SbkEnumType_TypeF();
}
namespace Enum
@@ -101,9 +103,8 @@ namespace Enum
LIBSHIBOKEN_API PyObject* newItem(PyTypeObject* enumType, long itemValue, const char* itemName = 0);
- /// \deprecated Use 'newTypeWithName'
- SBK_DEPRECATED(LIBSHIBOKEN_API PyTypeObject* newType(const char* name));
- LIBSHIBOKEN_API PyTypeObject* newTypeWithName(const char* name, const char* cppName);
+ LIBSHIBOKEN_API PyTypeObject* newTypeWithName(const char* name, const char* cppName,
+ PyTypeObject *numbers_fromFlag=nullptr);
LIBSHIBOKEN_API const char* getCppName(PyTypeObject* type);
LIBSHIBOKEN_API long getValue(PyObject* enumItem);