summaryrefslogtreecommitdiffstats
path: root/src/corelib/compat
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-31 11:10:26 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-02-01 11:47:58 +0000
commit0d9f4e7526fbf1e072aa3518e4e5313332ee4f18 (patch)
tree3d7c3a6851358c9ee87ba62b1f26cf8c1574ac37 /src/corelib/compat
parent2628e897fe3738ee86dacccea72e4a5b6aed9715 (diff)
Make one QT_REMOVED_SINCE/QT_BUILD_REMOVED_API per module
A single global QT_REMOVED_SINCE will start hurting us once more modules downstream of QtCore start using the mechanism. With every use of feature, the set of code that needs to compile under QT_BUILD_REMOVED_API increases. Since we use QT_REMOVED_SINCE in situations where overloading the new and the old function don't work in general, this means all code included by any removed_api.cpp needs to be very carefully written to ensure that any calls to the overload set formed by the combination of old and new function(s) don't create ambiguities. Likewise, the set of APIs that change semantics under QT_BUILD_REMOVED_API also increases. At some point, the combination of removed_api.cpp including almost every module header and almost every header exposing source-incompatibilities when included in removed_api.cpp will make maintenance a headache. By making QT_REMOVED_SINCE and QT_BUILD_REMOVED_API per-module (QT_CORE_REMOVED_SINCE, ...), easy now that we generate the export macros using CMake, we limit the scope of this problem to the module using the feature. Downstream modules (say, QtWidgets) will now see the QtCore API like every other user, even in the widgets/compat/removed_api.cpp TU. Pick-to: 6.3 Change-Id: I177bc7bd5aa8791639f97946c98e4592d2c7f9d9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/compat')
-rw-r--r--src/corelib/compat/removed_api.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
index d21813bbac..fda9a3fe72 100644
--- a/src/corelib/compat/removed_api.cpp
+++ b/src/corelib/compat/removed_api.cpp
@@ -37,13 +37,13 @@
**
****************************************************************************/
-#define QT_BUILD_REMOVED_API
+#define QT_CORE_BUILD_REMOVED_API
#include "qglobal.h"
QT_USE_NAMESPACE
-#if QT_REMOVED_SINCE(6, 1)
+#if QT_CORE_REMOVED_SINCE(6, 1)
#include "qmetatype.h"
@@ -58,9 +58,9 @@ int QMetaType::id() const
return 0;
}
-#endif // QT_REMOVED_SINCE(6, 1)
+#endif // QT_CORE_REMOVED_SINCE(6, 1)
-#if QT_REMOVED_SINCE(6, 3)
+#if QT_CORE_REMOVED_SINCE(6, 3)
#include "qbytearraymatcher.h"
@@ -141,9 +141,9 @@ int QOperatingSystemVersion::compare(const QOperatingSystemVersion &v1,
return QOperatingSystemVersionBase::compare(v1, v2);
}
-#endif // QT_REMOVED_SINCE(6, 3)
+#endif // QT_CORE_REMOVED_SINCE(6, 3)
-#if QT_REMOVED_SINCE(6, 4)
+#if QT_CORE_REMOVED_SINCE(6, 4)
#include "qcalendar.h"
@@ -178,4 +178,4 @@ QT_WARNING_POP
// #include <qotherheader.h>
// // implement removed functions from qotherheader.h
-#endif // QT_REMOVED_SINCE(6, 4)
+#endif // QT_CORE_REMOVED_SINCE(6, 4)