summaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/sbkconverter.h4
-rw-r--r--libshiboken/sbkenum.cpp5
2 files changed, 6 insertions, 3 deletions
diff --git a/libshiboken/sbkconverter.h b/libshiboken/sbkconverter.h
index 0edd5abb..463014fd 100644
--- a/libshiboken/sbkconverter.h
+++ b/libshiboken/sbkconverter.h
@@ -282,7 +282,7 @@ template<> inline SbkConverter* PrimitiveTypeConverter<void*>() { return primiti
} } // namespace Shiboken::Conversions
-struct _SbkGenericType { PyHeapTypeObject super; SbkConverter* converter; };
-#define SBK_CONVERTER(objType) (reinterpret_cast<_SbkGenericType*>(objType)->converter)
+struct _SbkGenericType { PyHeapTypeObject super; SbkConverter** converter; };
+#define SBK_CONVERTER(pyType) (*reinterpret_cast<_SbkGenericType*>(pyType)->converter)
#endif // SBK_CONVERTER_H
diff --git a/libshiboken/sbkenum.cpp b/libshiboken/sbkenum.cpp
index c2f6ce0c..306ffc8d 100644
--- a/libshiboken/sbkenum.cpp
+++ b/libshiboken/sbkenum.cpp
@@ -41,6 +41,7 @@ extern "C"
struct SbkEnumType
{
PyHeapTypeObject super;
+ SbkConverter** converterPtr;
SbkConverter* converter;
const char* cppName;
};
@@ -533,7 +534,9 @@ PyTypeObject* newTypeWithName(const char* name, const char* cppName)
type->tp_richcompare = &enum_richcompare;
type->tp_hash = &enum_hash;
- reinterpret_cast<SbkEnumType*>(type)->cppName = cppName;
+ SbkEnumType* enumType = reinterpret_cast<SbkEnumType*>(type);
+ enumType->cppName = cppName;
+ enumType->converterPtr = &enumType->converter;
DeclaredEnumTypes::instance().addEnumType(type);
return type;
}