From 43ec3d8d011f1c067be2257ba657838f2c118415 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sun, 12 Feb 2023 17:31:11 +0200 Subject: [PATCH] Break some include cycles in qglobal.h [1/3] Remove qglobal.h include from qcompilerdetection.h, qsystemdetection.h and modulecppexports.h.in Testing locally, the code builds on Linux with precompiled headers disabled/enabled (qt_pch.h includes qglobal.h, so building with PCH enabled isn't useful for testing this) and with/without bootstrap. qrunnable.*: missing includes detected by compiling with -DFEATURE_headersclean=ON. Task-number: QTBUG-106722 Change-Id: I70864dfbf117ffd7fe492eb715a413eb6f209990 Reviewed-by: Thiago Macieira --- cmake/modulecppexports.h.in | 8 ++++---- src/corelib/global/qcompilerdetection.h | 4 +--- src/corelib/global/qexceptionhandling.h | 1 + src/corelib/global/qsystemdetection.h | 4 ---- src/corelib/thread/qrunnable.cpp | 2 ++ src/corelib/thread/qrunnable.h | 2 ++ 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cmake/modulecppexports.h.in b/cmake/modulecppexports.h.in index d4864bb9d4..324e86faa7 100644 --- a/cmake/modulecppexports.h.in +++ b/cmake/modulecppexports.h.in @@ -1,13 +1,13 @@ // Copyright (C) 2022 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 -// This file is autogenerated. Changes will be overwritten. - -#include - #ifndef @header_base_name_upper@_H #define @header_base_name_upper@_H +#include +#include // Q_@module_define_infix@_EXPORT +#include // QT_IF_DEPRECATED_SINCE + #if defined(QT_SHARED) || !defined(QT_STATIC) # if defined(QT_BUILD_@module_define_infix@_LIB) # define Q_@module_define_infix@_EXPORT Q_DECL_EXPORT diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index d52722afb7..c9d415d133 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -2,9 +2,7 @@ // Copyright (C) 2016 Intel Corporation. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QGLOBAL_H -# include -#endif +#include #if 0 #pragma qt_class(QtCompilerDetection) diff --git a/src/corelib/global/qexceptionhandling.h b/src/corelib/global/qexceptionhandling.h index aca8de9003..76c6185c3e 100644 --- a/src/corelib/global/qexceptionhandling.h +++ b/src/corelib/global/qexceptionhandling.h @@ -6,6 +6,7 @@ #include #include +#include #if 0 #pragma qt_class(QtExceptionHandling) diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 3a992f2aba..50acd688d6 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -2,10 +2,6 @@ // Copyright (C) 2019 Intel Corporation. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QGLOBAL_H -# include -#endif - #if 0 #pragma qt_class(QtSystemDetection) #pragma qt_sync_skip_header_check diff --git a/src/corelib/thread/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp index 684593e16b..5418fc8ecf 100644 --- a/src/corelib/thread/qrunnable.cpp +++ b/src/corelib/thread/qrunnable.cpp @@ -3,6 +3,8 @@ #include "qrunnable.h" +#include + QT_BEGIN_NAMESPACE QRunnable::~QRunnable() diff --git a/src/corelib/thread/qrunnable.h b/src/corelib/thread/qrunnable.h index 9471bbe1a2..853228200f 100644 --- a/src/corelib/thread/qrunnable.h +++ b/src/corelib/thread/qrunnable.h @@ -6,6 +6,8 @@ #include #include +#include +#include #include #include