summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-02-21 22:38:15 +0200
committerMartin Storsjö <martin@martin.st>2018-02-22 05:14:36 +0000
commitb97765efd452921f75c1d04820c4b5e9e9d49100 (patch)
treeb8b1143da9074ccb447f841c1b9b95088afba5f6 /src
parent02eb264aa2db20fac479a749c39044cc9ed304b2 (diff)
moc: Only use the init_priority attribute when targeting windows
While both GCC and the GCC compatible clang support this attribute in general, GCC doesn't support it when targeting macOS, ending up with errors like these: error: 'init_priority' attribute is not supported on this platform This error isn't a property of the platform itself though, since clang supports the attribute just fine on macOS. The attribute is only used to work around an issue with dllimport on windows, so limit its use to that platform, to avoid issues with it potentially being unsupported on platforms other than macOS as well. This fixes compiling with GCC for macOS. Change-Id: I0235e6365635d73233951566c10ad869b26a0fc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qglobal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index aa9446221b..cd4b4a29a9 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -549,7 +549,7 @@ using qsizetype = QIntegerForSizeof<std::size_t>::Signed;
# define Q_ALWAYS_INLINE inline
#endif
-#ifdef Q_CC_GNU
+#if defined(Q_CC_GNU) && defined(Q_OS_WIN)
# define QT_INIT_METAOBJECT __attribute__((init_priority(101)))
#else
# define QT_INIT_METAOBJECT