From 0771075f664e1a49e586357bc86c915042e440eb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 6 Sep 2013 13:17:57 +0200 Subject: [PATCH] Move the preprocessor iterator for Qt smart pointers with the others. Use it to forward declare the types. Change-Id: I48d9e32dcf02471d197a82502d96d60807d11d57 Reviewed-by: Olivier Goffart --- src/corelib/kernel/qmetatype.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 57a622ebe5..6b1a988fce 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -206,6 +206,11 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId(); F(QMap, class) \ F(QPair, struct) +#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(F) \ + F(QSharedPointer) \ + F(QWeakPointer) \ + F(QPointer) + class QDataStream; class QMetaTypeInterface; struct QMetaObject; @@ -1234,9 +1239,11 @@ struct QPairVariantInterfaceConvertFunctor > class QObject; class QWidget; -template class QSharedPointer; -template class QWeakPointer; -template class QPointer; + +#define QT_FORWARD_DECLARE_SHARED_POINTER_TYPES_ITER(Name) \ + template class Name; \ + +QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(QT_FORWARD_DECLARE_SHARED_POINTER_TYPES_ITER) namespace QtPrivate { @@ -1844,11 +1851,6 @@ struct QMetaTypeId< SMART_POINTER > \ };\ QT_END_NAMESPACE -#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(F) \ - F(QSharedPointer) \ - F(QWeakPointer) \ - F(QPointer) - #define Q_DECLARE_METATYPE_TEMPLATE_1ARG_ITER(TEMPLATENAME) \ QT_BEGIN_NAMESPACE \ template class TEMPLATENAME; \