From e40ea467df17d2cff1ca51c7b02a31962a5a1622 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 15 Sep 2010 19:31:26 -0500 Subject: Fixed Q_DECLARE_METATYPE for aix-xlc XLC needs to see the full declaration of these classes to use them in templates, where other compilers are satisfied with a forward declaration. Reviewed-by: Kevin Wu Won --- src/corelib/kernel/qmetatype.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 2108b92..e16ffe8 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -156,7 +156,18 @@ void qMetaTypeLoadHelper(QDataStream &stream, T *t) } #endif // QT_NO_DATASTREAM -template struct QMetaTypeId2; +template +struct QMetaTypeId +{ + enum { Defined = 0 }; +}; + +template +struct QMetaTypeId2 +{ + enum { Defined = QMetaTypeId::Defined }; + static inline int qt_metatype_id() { return QMetaTypeId::qt_metatype_id(); } +}; namespace QtPrivate { template ::Defined> @@ -210,19 +221,6 @@ void qRegisterMetaTypeStreamOperators(const char *typeName #endif // QT_NO_DATASTREAM template -struct QMetaTypeId -{ - enum { Defined = 0 }; -}; - -template -struct QMetaTypeId2 -{ - enum { Defined = QMetaTypeId::Defined }; - static inline int qt_metatype_id() { return QMetaTypeId::qt_metatype_id(); } -}; - -template inline int qMetaTypeId( #ifndef qdoc T * /* dummy */ = 0 -- cgit v0.12