From a38cebfe23674bb459eed6bbbcac965ebf2b6075 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 11 Dec 2024 15:47:22 +0100 Subject: [PATCH] qsocketnotifier.cpp: un-break -unity-build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qsocketnotifier.cpp is using a #define to activate a second overload of QSocketNotifier's activated() signal. In unity-builds, this overload becomes visible to other TUs and breaks new-style connect()s¹. In PCH builds, the define comes too late (the qsocketnotifier.h header was already included by the pch header, without the define). Fix by adding qsocketnotifier.cpp to NO_PCH_SOURCES (thereby to NO_UNITY_BUILD_SOURCES, too). ¹ and the signal's use of QPrivateSignal makes disambiguation by qOverload(), or assignment to a function pointer, impossible. Amends 487dd80bce9c6006f349ccb09222e1c308200f0a(!). Pick-to: 6.9 6.8 6.5 5.15 Change-Id: I40ca3b90f7ecc3116ae78dc952583efa299bcedb Reviewed-by: Thiago Macieira Reviewed-by: Friedemann Kleint --- src/corelib/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 4fa158639e4..6b6836df811 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -336,6 +336,7 @@ qt_internal_add_module(Core NO_PCH_SOURCES compat/removed_api.cpp global/qsimd.cpp + kernel/qsocketnotifier.cpp # defines BUILDING_QSOCKETNOTIFIER DEFINES QT_NO_CONTEXTLESS_CONNECT QT_NO_FOREACH