| 1 | // Copyright (C) 2022 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTNETWORKEXPORTS_H |
| 5 | #define QTNETWORKEXPORTS_H |
| 6 | |
| 7 | #include <QtCore/qcompilerdetection.h> |
| 8 | #include <QtCore/qtconfigmacros.h> // Q_NETWORK_EXPORT |
| 9 | #include <QtCore/qtdeprecationmarkers.h> // QT_IF_DEPRECATED_SINCE |
| 10 | |
| 11 | #if defined(QT_SHARED) || !defined(QT_STATIC) |
| 12 | # if defined(QT_BUILD_NETWORK_LIB) |
| 13 | # define Q_NETWORK_EXPORT Q_DECL_EXPORT |
| 14 | # else |
| 15 | # define Q_NETWORK_EXPORT Q_DECL_IMPORT |
| 16 | # endif |
| 17 | #else |
| 18 | # define Q_NETWORK_EXPORT |
| 19 | #endif |
| 20 | |
| 21 | #if !defined(QT_BUILD_NETWORK_LIB) && !defined(QT_STATIC) |
| 22 | /* outside library -> inline decl + defi */ |
| 23 | /* static builds treat everything as part of the library, so they never inline */ |
| 24 | # define QT_NETWORK_INLINE_SINCE(major, minor) inline |
| 25 | # define QT_NETWORK_INLINE_IMPL_SINCE(major, minor) 1 |
| 26 | #elif defined(QT_NETWORK_BUILD_REMOVED_API) |
| 27 | /* inside library, inside removed_api.cpp: |
| 28 | * keep deprecated API -> non-inline decl; |
| 29 | * remove deprecated API -> inline decl; |
| 30 | * definition is always available */ |
| 31 | # define QT_NETWORK_INLINE_SINCE(major, minor) \ |
| 32 | QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */) |
| 33 | # define QT_NETWORK_INLINE_IMPL_SINCE(major, minor) 1 |
| 34 | #else |
| 35 | /* inside library, outside removed_api.cpp: |
| 36 | * keep deprecated API -> non-inline decl, no defi; |
| 37 | * remove deprecated API -> inline decl, defi */ |
| 38 | # define QT_NETWORK_INLINE_SINCE(major, minor) \ |
| 39 | QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */) |
| 40 | # define QT_NETWORK_INLINE_IMPL_SINCE(major, minor) \ |
| 41 | QT_IF_DEPRECATED_SINCE(major, minor, 1, 0) |
| 42 | #endif |
| 43 | |
| 44 | #ifdef QT_NETWORK_BUILD_REMOVED_API |
| 45 | # define QT_NETWORK_REMOVED_SINCE(major, minor) QT_DEPRECATED_SINCE(major, minor) |
| 46 | #else |
| 47 | # define QT_NETWORK_REMOVED_SINCE(major, minor) 0 |
| 48 | #endif |
| 49 | |
| 50 | #endif // QTNETWORKEXPORTS_H |
| 51 | |