From 0677d334f85f6d39f6f6495162eec69712e42370 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sun, 12 Feb 2023 23:50:54 +0200 Subject: [PATCH] Break cyclic includes in qglobal.h [2/3] Task-number: QTBUG-106722 Change-Id: I6cf2b3fcd419659cc8a0633892393febd26e505b Reviewed-by: Thiago Macieira --- src/corelib/global/qcompare_impl.h | 9 +++++---- src/corelib/global/qflags.h | 6 +++--- src/corelib/global/qglobalstatic.h | 3 +-- src/corelib/global/qlogging.h | 8 ++++++-- src/corelib/global/qnumeric.h | 4 +++- src/corelib/global/qsysinfo.h | 8 ++++++-- src/corelib/global/qtypeinfo.h | 9 +++++---- src/corelib/global/qversiontagging.h | 8 +++++--- src/corelib/tools/qcontainerfwd.h | 5 +++-- 9 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/corelib/global/qcompare_impl.h b/src/corelib/global/qcompare_impl.h index 2556f4af6b..c52417fcec 100644 --- a/src/corelib/global/qcompare_impl.h +++ b/src/corelib/global/qcompare_impl.h @@ -1,15 +1,16 @@ // Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +#ifndef QCOMPARE_IMPL_H +#define QCOMPARE_IMPL_H + #if 0 #pragma qt_sync_skip_header_check #pragma qt_sync_stop_processing #endif -#ifndef QCOMPARE_IMPL_H -#define QCOMPARE_IMPL_H - -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index 26a8e5c9cf..cc028e0095 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -1,12 +1,12 @@ // Copyright (C) 2016 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 -#include -#include - #ifndef QFLAGS_H #define QFLAGS_H +#include +#include + #include QT_BEGIN_NAMESPACE diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h index d865e08fdd..3f626e88c1 100644 --- a/src/corelib/global/qglobalstatic.h +++ b/src/corelib/global/qglobalstatic.h @@ -1,12 +1,11 @@ // Copyright (C) 2021 Intel Corporation. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#include - #ifndef QGLOBALSTATIC_H #define QGLOBALSTATIC_H #include +#include #include // for bootstrapped (no thread) builds #include diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index 002125f8d9..44821b4463 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -1,11 +1,14 @@ // Copyright (C) 2016 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 -#include - #ifndef QLOGGING_H #define QLOGGING_H +#include +#include +#include +#include + #if 0 // header is automatically included in qglobal.h #pragma qt_no_master_include @@ -22,6 +25,7 @@ QT_BEGIN_NAMESPACE class QDebug; class QNoDebug; + enum QtMsgType { QtDebugMsg, QtWarningMsg, diff --git a/src/corelib/global/qnumeric.h b/src/corelib/global/qnumeric.h index 7779c03515..2238c13da0 100644 --- a/src/corelib/global/qnumeric.h +++ b/src/corelib/global/qnumeric.h @@ -8,7 +8,9 @@ #pragma qt_class(QtNumeric) #endif -#include +#include +#include +#include #include #include diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index b1d7f000be..01f6313299 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -2,11 +2,13 @@ // 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 -#include - #ifndef QSYSINFO_H #define QSYSINFO_H +#include +#include +#include + QT_BEGIN_NAMESPACE /* @@ -14,6 +16,8 @@ QT_BEGIN_NAMESPACE */ class QString; +class QByteArray; + class Q_CORE_EXPORT QSysInfo { public: diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index b07c9f4afe..e6d63241bb 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -2,15 +2,16 @@ // 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 -#include +#ifndef QTYPEINFO_H +#define QTYPEINFO_H + +#include #include + #include #include #include -#ifndef QTYPEINFO_H -#define QTYPEINFO_H - QT_BEGIN_NAMESPACE class QDebug; diff --git a/src/corelib/global/qversiontagging.h b/src/corelib/global/qversiontagging.h index 05d0998c45..73faf5b6eb 100644 --- a/src/corelib/global/qversiontagging.h +++ b/src/corelib/global/qversiontagging.h @@ -1,12 +1,14 @@ // Copyright (C) 2022 Intel Corporation. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -// qglobal.h includes this header, so keep it outside of our include guards -#include - #if !defined(QVERSIONTAGGING_H) #define QVERSIONTAGGING_H +#include +#include +#include +#include + QT_BEGIN_NAMESPACE /* diff --git a/src/corelib/tools/qcontainerfwd.h b/src/corelib/tools/qcontainerfwd.h index b876c4648f..013ba9eab0 100644 --- a/src/corelib/tools/qcontainerfwd.h +++ b/src/corelib/tools/qcontainerfwd.h @@ -1,11 +1,12 @@ // Copyright (C) 2020 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 -#include - #ifndef QCONTAINERFWD_H #define QCONTAINERFWD_H +#include +#include + #if 0 #pragma qt_class(QtContainerFwd) #endif