aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldebug
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-08-06 17:03:37 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-08-17 18:04:35 +0200
commit8edbcdbeb49630c207f3111d24b9c9e07029e333 (patch)
treeb1c6f0a88c19f69126e6915cdefab81c44fdab06 /src/qmldebug
parent2ed0abd5533750343a382f5b4ab5dcab6d52eff2 (diff)
Mark the module as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses is high here, too high for this author, unfamiliar with this code, to tackle in a short amount of time. But they're concentrated in just a few TUs, so pick a different strategy: Mark the whole module with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). Created QTBUG-115808 to keep track of this. Task-number: QTBUG-115808 Change-Id: I29c377f939e3d747e3ce72c224c4ee722df7a95d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmldebug')
-rw-r--r--src/qmldebug/CMakeLists.txt2
-rw-r--r--src/qmldebug/qv4debugclient.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/qmldebug/CMakeLists.txt b/src/qmldebug/CMakeLists.txt
index 084e90cc19..052c9bfd60 100644
--- a/src/qmldebug/CMakeLists.txt
+++ b/src/qmldebug/CMakeLists.txt
@@ -34,6 +34,8 @@ qt_internal_add_module(QmlDebugPrivate
qqmlprofilertypedevent.cpp qqmlprofilertypedevent_p.h
qv4debugclient.cpp qv4debugclient_p.h
qv4debugclient_p_p.h
+ NO_PCH_SOURCES
+ qv4debugclient.cpp # undef QT_NO_FOREACH
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::Network
diff --git a/src/qmldebug/qv4debugclient.cpp b/src/qmldebug/qv4debugclient.cpp
index cb05a015a7..87f6a67d22 100644
--- a/src/qmldebug/qv4debugclient.cpp
+++ b/src/qmldebug/qv4debugclient.cpp
@@ -1,6 +1,8 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
+
#include "qv4debugclient_p.h"
#include "qv4debugclient_p_p.h"
#include "qqmldebugconnection_p.h"