From 61935786c30b0209811fa32f7a02f138da8570b2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 20 Nov 2022 20:11:00 -0800 Subject: [PATCH] Move duplicated code between two headers to include qconfig.h Change-Id: I76216ced393445a4ae2dfffd17297e2b059350d3 Reviewed-by: Fabian Kosmale --- src/corelib/CMakeLists.txt | 1 + src/corelib/global/qtconfiginclude.h | 21 +++++++++++++++++++++ src/corelib/global/qtconfigmacros.h | 11 ++--------- src/corelib/global/qtversionchecks.h | 10 +--------- 4 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 src/corelib/global/qtconfiginclude.h diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index c42f01c3c9..32a6d65ece 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -85,6 +85,7 @@ qt_internal_add_module(Core global/qsysinfo.cpp global/qsysinfo.h global/qsystemdetection.h global/qtclasshelpermacros.h + global/qtconfiginclude.h global/qtconfigmacros.h global/qtdeprecationmarkers.h global/qtenvironmentvariables.cpp global/qtenvironmentvariables.h diff --git a/src/corelib/global/qtconfiginclude.h b/src/corelib/global/qtconfiginclude.h new file mode 100644 index 0000000000..98f104b0e4 --- /dev/null +++ b/src/corelib/global/qtconfiginclude.h @@ -0,0 +1,21 @@ +// 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 + +#ifndef QTCONFIGINCLUDE_H +#define QTCONFIGINCLUDE_H + +#if 0 +# pragma qt_sync_stop_processing +#endif + +#ifdef QT_BOOTSTRAPPED +// qconfig-bootstrapped.h is not supposed to be a part of the synced header files. So we find it by +// the include path specified for Bootstrap library in the source tree instead of the build tree as +// it's done for regular header files. +#include "qconfig-bootstrapped.h" +#else +#include +#include +#endif + +#endif // QTCONFIGINCLUDE_H diff --git a/src/corelib/global/qtconfigmacros.h b/src/corelib/global/qtconfigmacros.h index 7d42b13c54..2bb1016cac 100644 --- a/src/corelib/global/qtconfigmacros.h +++ b/src/corelib/global/qtconfigmacros.h @@ -7,15 +7,8 @@ #if 0 # pragma qt_sync_stop_processing #endif -#ifdef QT_BOOTSTRAPPED -// qconfig-bootstrapped.h is not supposed to be a part of the synced header files. So we find it by -// the include path specified for Bootstrap library in the source tree instead of the build tree as -// it's done for regular header files. -#include "qconfig-bootstrapped.h" -#else -#include -#include -#endif + +#include /* The Qt modules' export macros. diff --git a/src/corelib/global/qtversionchecks.h b/src/corelib/global/qtversionchecks.h index d3b7a7b082..72b62ce105 100644 --- a/src/corelib/global/qtversionchecks.h +++ b/src/corelib/global/qtversionchecks.h @@ -9,15 +9,7 @@ #pragma qt_sync_stop_processing #endif -#ifdef QT_BOOTSTRAPPED -// qconfig-bootstrapped.h is not supposed to be a part of the synced header files. So we find it by -// the include path specified for Bootstrap library in the source tree instead of the build tree as -// it's done for regular header files. -#include "qconfig-bootstrapped.h" -#else -#include -#include -#endif +#include /* QT_VERSION is (major << 16) | (minor << 8) | patch.