diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-09-16 00:31:26 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-09-16 01:04:55 (GMT) |
commit | e40ea467df17d2cff1ca51c7b02a31962a5a1622 (patch) | |
tree | 9db7b391cb944211cc2ca30ceabeb6e37054644f | |
parent | ab31c1a482630007eccd532b49e03f0345421aa8 (diff) | |
download | Qt-e40ea467df17d2cff1ca51c7b02a31962a5a1622.zip Qt-e40ea467df17d2cff1ca51c7b02a31962a5a1622.tar.gz Qt-e40ea467df17d2cff1ca51c7b02a31962a5a1622.tar.bz2 |
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
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 26 |
1 files 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 <typename T> struct QMetaTypeId2; +template <typename T> +struct QMetaTypeId +{ + enum { Defined = 0 }; +}; + +template <typename T> +struct QMetaTypeId2 +{ + enum { Defined = QMetaTypeId<T>::Defined }; + static inline int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); } +}; namespace QtPrivate { template <typename T, bool Defined = QMetaTypeId2<T>::Defined> @@ -210,19 +221,6 @@ void qRegisterMetaTypeStreamOperators(const char *typeName #endif // QT_NO_DATASTREAM template <typename T> -struct QMetaTypeId -{ - enum { Defined = 0 }; -}; - -template <typename T> -struct QMetaTypeId2 -{ - enum { Defined = QMetaTypeId<T>::Defined }; - static inline int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); } -}; - -template <typename T> inline int qMetaTypeId( #ifndef qdoc T * /* dummy */ = 0 |