summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-02-04 16:30:52 -0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-16 19:04:02 +0000
commit89e8a07a90a4ebbdf71425f8edbdea8a6489c642 (patch)
tree012cdaf21d1757851237fdfcda7d85bbb9590f43
parent98795d9dd81ebd9a24cc02ef4d7c49eb314efbfe (diff)
qglobal: Move the export macros further up in the file
Before the #ifdef __cplusplus and namespace start. We don't need to export anything from C (and I hope that remains the case), but at least this removes the need for QT_{BEGIN,END}_INCLUDE_NAMESPACE. Which also weren't needed. Change-Id: I54f205f6b7314351b078fffd16d0bc84c57cb2ec Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 0e84d04b90a7e98847f92a2d644120d23c7c051c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/corelib/global/qglobal.h60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 6f5a4de092..6e83b78f4b 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -69,6 +69,35 @@
#endif
/*
+ The Qt modules' export macros.
+ The options are:
+ - defined(QT_STATIC): Qt was built or is being built in static mode
+ - defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
+ If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
+ mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
+ for the bootstrapped tools.
+*/
+
+#ifdef QT_BOOTSTRAPPED
+# ifdef QT_SHARED
+# error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
+# elif !defined(QT_STATIC)
+# define QT_STATIC
+# endif
+#endif
+
+#if defined(QT_SHARED) || !defined(QT_STATIC)
+# ifdef QT_STATIC
+# error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
+# endif
+# ifndef QT_SHARED
+# define QT_SHARED
+# endif
+#endif
+
+#include <QtCore/qtcoreexports.h>
+
+/*
The QT_CONFIG macro implements a safe compile time check for features of Qt.
Features can be in three states:
0 or undefined: This will lead to a compile error when testing for it
@@ -461,37 +490,6 @@ constexpr inline Deprecated_t Deprecated = {};
#endif
/*
- The Qt modules' export macros.
- The options are:
- - defined(QT_STATIC): Qt was built or is being built in static mode
- - defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
- If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
- mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
- for the bootstrapped tools.
-*/
-
-#ifdef QT_BOOTSTRAPPED
-# ifdef QT_SHARED
-# error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
-# elif !defined(QT_STATIC)
-# define QT_STATIC
-# endif
-#endif
-
-#if defined(QT_SHARED) || !defined(QT_STATIC)
-# ifdef QT_STATIC
-# error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
-# endif
-# ifndef QT_SHARED
-# define QT_SHARED
-# endif
-#endif
-
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <QtCore/qtcoreexports.h>
-QT_END_INCLUDE_NAMESPACE
-
-/*
Some classes do not permit copies to be made of an object. These
classes contains a private copy constructor and assignment
operator to disable copying (the compiler gives an error message).