qtbase/cmake/modulecppexports.h.in
Thiago Macieira 97a6512724 QByteArray/QList/QString: mark isEmpty() and isNull() constexpr
Since QByteArray::isNull() wasn't inline until Qt 6.4, we needed a new
macro in the module C++ exports header, which may come in handy for
future uses.

Change-Id: I059fc46ce7b340a68b39fffdd65f6d2255c9c5cc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-02-13 18:06:28 -08:00

56 lines
2.4 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
#ifndef @header_base_name_upper@_H
#define @header_base_name_upper@_H
#include <QtCore/qcompilerdetection.h>
#include <QtCore/qtconfigmacros.h> // Q_@module_define_infix@_EXPORT
#include <QtCore/qtdeprecationmarkers.h> // 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
# 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 */
/* static builds treat everything as part of the library, so they never inline */
# define QT_@module_define_infix@_INLINE_SINCE(major, minor) inline
# define QT_@module_define_infix@_CONSTEXPR_INLINE_SINCE(major, minor) constexpr
# 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@_CONSTEXPR_INLINE_SINCE(major, minor) \
QT_IF_DEPRECATED_SINCE(major, minor, constexpr, /* 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@_CONSTEXPR_INLINE_SINCE(major, minor) \
QT_IF_DEPRECATED_SINCE(major, minor, constexpr, /* 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