summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-05-03 23:40:00 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-05-04 16:43:30 +0000
commita4e3e34b83640b4f245d83e4034179e5efe9c517 (patch)
tree100fc3a20d53691e1df8a49495a027bff05fea00
parent3489ab60a992f060c3e737838cc78ac79f79cc31 (diff)
Let Q_DECLARE_METATYPE and Q_DECLARE_FLAGS be undefined under Q_MOC_RUN
That's required so that they remain in the output from the preprocessor Change-Id: Id69569111e7d4e619e22ffff144b4a1ee90865f0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r--src/corelib/global/qflags.h5
-rw-r--r--src/corelib/kernel/qmetatype.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index f3082a1e39..a6bd37c33f 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -163,8 +163,10 @@ private:
Int i;
};
+#ifndef Q_MOC_RUN
#define Q_DECLARE_FLAGS(Flags, Enum)\
typedef QFlags<Enum> Flags;
+#endif
#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
Q_DECL_CONSTEXPR inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) Q_DECL_NOTHROW \
@@ -179,8 +181,11 @@ Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1,
#else /* Q_NO_TYPESAFE_FLAGS */
+#ifndef Q_MOC_RUN
#define Q_DECLARE_FLAGS(Flags, Enum)\
typedef uint Flags;
+#endif
+
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
#endif /* Q_NO_TYPESAFE_FLAGS */
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 60a260f4e7..f4989975ee 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -1855,6 +1855,7 @@ inline int qRegisterMetaTypeStreamOperators()
} QT_END_NAMESPACE \
/**/
+#ifndef Q_MOC_RUN
#define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
#define Q_DECLARE_METATYPE_IMPL(TYPE) \
QT_BEGIN_NAMESPACE \
@@ -1874,7 +1875,7 @@ inline int qRegisterMetaTypeStreamOperators()
} \
}; \
QT_END_NAMESPACE
-
+#endif // Q_MOC_RUN
#define Q_DECLARE_BUILTIN_METATYPE(TYPE, METATYPEID, NAME) \
QT_BEGIN_NAMESPACE \