qt5base-lts/cmake/modulecppexports.h.in
Ivan Solovev 9d1e928512 Do not include qglobal.h into the new headers
Several new headers were extracted from qglobal.h in scope of
QTBUG-99313. This commit makes sure that none of them actually includes
qglobal.h.
As those files are new, it should be safe to introduce this change, as
it shouldn't have any impact on the user code.

This patch also modifies the autogenerated module exports header to
include qglobal.h before the include guard. This is needed to prevent
circular dependencies which result in Q_<MODULE>_EXPORT being
undefined.

Task-number: QTBUG-107046
Change-Id: I8d998792fd8129173d9ec811557e7d7604282813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-06 14:26:25 +02:00

48 lines
1.8 KiB
C

// 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
#include <QtCore/qglobal.h>
#ifndef @header_base_name_upper@_H
#define @header_base_name_upper@_H
#if defined(QT_SHARED) || !defined(QT_STATIC)
# if defined(QT_BUILD_@module_define_infix@_LIB)
# define Q_@module_define_infix@_EXPORT Q_DECL_EXPORT
# else
# define Q_@module_define_infix@_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_@module_define_infix@_EXPORT
#endif
#if !defined(QT_BUILD_@module_define_infix@_LIB) || defined(QT_STATIC)
/* outside library → inline decl + defi */
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) inline
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1
#elif defined(QT_@module_define_infix@_BUILD_REMOVED_API)
/* inside library, inside removed_api.cpp:
* keep deprecated API → non-inline decl;
* remove deprecated API → inline decl;
* definition is always available */
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */)
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) 1
#else
/* inside library, outside removed_api.cpp:
* keep deprecated API → non-inline decl, no defi;
* remove deprecated API → inline decl, defi */
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) \
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */)
# define QT_@module_define_infix@_INLINE_IMPL_SINCE(major, minor) \
QT_IF_DEPRECATED_SINCE(major, minor, 1, 0)
#endif
#ifdef QT_@module_define_infix@_BUILD_REMOVED_API
# define QT_@module_define_infix@_REMOVED_SINCE(major, minor) QT_DEPRECATED_SINCE(major, minor)
#else
# define QT_@module_define_infix@_REMOVED_SINCE(major, minor) 0
#endif
#endif // @header_base_name_upper@_H