aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkenum.h
diff options
context:
space:
mode:
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);