diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-12-13 16:12:32 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-19 10:21:16 +0100 |
commit | 31d8ecfe3b6b5ab27e4bb36aeeeae917e0aabc23 (patch) | |
tree | 171fc47b8cfe04dfd2c734e24679c99f7f97db7f /src/corelib/kernel/qmetatype.cpp | |
parent | e75e4421cdcaba1e0c2920251b114d0318155d3c (diff) |
Make QMetaTypeInterface POD.
QMetaTypeInterface has to be POD because it is constructed in a static
array. Constructors in POD types are not allowed so we will use a macro
instead.
Change-Id: Iab9ae776dfe4dcd7148558f02d6181c5917aa5c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 76537c79cb..d5a22ef07d 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -297,6 +297,14 @@ public: int alias; }; +namespace +{ +union CheckThatItIsPod +{ // This should break if QMetaTypeInterface is not a POD type + QMetaTypeInterface iface; +}; +} + Q_DECLARE_TYPEINFO(QCustomTypeInfo, Q_MOVABLE_TYPE); Q_GLOBAL_STATIC(QVector<QCustomTypeInfo>, customTypes) Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock) @@ -454,6 +462,10 @@ int QMetaType::registerType(const char *typeName, Deleter deleter, inf.typeName = normalizedTypeName; inf.creator = creator; inf.deleter = deleter; +#ifndef QT_NO_DATASTREAM + inf.loadOp = 0; + inf.saveOp = 0; +#endif inf.alias = -1; inf.constructor = constructor; inf.destructor = destructor; |