Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:09:35

0001 // Copyright (C) 2022 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QTCONFIGMACROS_H
0005 #define QTCONFIGMACROS_H
0006 
0007 #if 0
0008 #  pragma qt_sync_stop_processing
0009 #endif
0010 
0011 #include <QtCore/qtconfiginclude.h>
0012 #include <QtCore/qtdeprecationdefinitions.h>
0013 #include <QtCore/qtversionchecks.h>
0014 
0015 #include <assert.h>
0016 
0017 /*
0018    The Qt modules' export macros.
0019    The options are:
0020     - defined(QT_STATIC): Qt was built or is being built in static mode
0021     - defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
0022    If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
0023    mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
0024    for the bootstrapped tools.
0025 */
0026 
0027 #ifdef QT_BOOTSTRAPPED
0028 #  ifdef QT_SHARED
0029 #    error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
0030 #  elif !defined(QT_STATIC)
0031 #    define QT_STATIC
0032 #  endif
0033 #endif
0034 
0035 #if defined(QT_SHARED) || !defined(QT_STATIC)
0036 #  ifdef QT_STATIC
0037 #    error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
0038 #  endif
0039 #  ifndef QT_SHARED
0040 #    define QT_SHARED
0041 #  endif
0042 #endif
0043 
0044 /*
0045    No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
0046    for Qt's internal unit tests. If you want slower loading times and more
0047    symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
0048 
0049    \note After adding Q_AUTOTEST_EXPORT to a method, you'll need to wrap any unittests
0050    that will use that method in "#ifdef QT_BUILD_INTERNAL".
0051 */
0052 #if defined(QT_BUILD_INTERNAL) && defined(QT_BUILDING_QT) && defined(QT_SHARED)
0053 #    define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
0054 #elif defined(QT_BUILD_INTERNAL) && defined(QT_SHARED)
0055 #    define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
0056 #else
0057 #    define Q_AUTOTEST_EXPORT
0058 #endif
0059 
0060 /*
0061     The QT_CONFIG macro implements a safe compile time check for features of Qt.
0062     Features can be in three states:
0063         0 or undefined: This will lead to a compile error when testing for it
0064         -1: The feature is not available
0065         1: The feature is available
0066 */
0067 #define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
0068 #define QT_REQUIRE_CONFIG(feature) static_assert(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
0069 
0070 /* moc compats (signals/slots) */
0071 #ifndef QT_MOC_COMPAT
0072 #  define QT_MOC_COMPAT
0073 #else
0074 #  undef QT_MOC_COMPAT
0075 #  define QT_MOC_COMPAT
0076 #endif
0077 
0078 /*
0079    Debugging and error handling
0080 */
0081 
0082 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
0083 #  define QT_DEBUG
0084 #endif
0085 
0086 // valid for both C and C++
0087 #define QT_MANGLE_NAMESPACE0(x) x
0088 #define QT_MANGLE_NAMESPACE1(a, b) a##_##b
0089 #define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
0090 #if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
0091 # define QT_MANGLE_NAMESPACE(name) name
0092 #else
0093 # define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \
0094         QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
0095 #endif
0096 
0097 #ifdef __cplusplus
0098 
0099 #if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
0100 
0101 # define QT_PREPEND_NAMESPACE(name) ::name
0102 # define QT_USE_NAMESPACE
0103 # define QT_BEGIN_NAMESPACE
0104 # define QT_END_NAMESPACE
0105 # define QT_BEGIN_INCLUDE_NAMESPACE
0106 # define QT_END_INCLUDE_NAMESPACE
0107 # define QT_FORWARD_DECLARE_CLASS(name) class name;
0108 # define QT_FORWARD_DECLARE_STRUCT(name) struct name;
0109 
0110 #elif defined(QT_INLINE_NAMESPACE) /* user inline namespace FIXME in Qt 7: Default */
0111 
0112 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
0113 # define QT_USE_NAMESPACE
0114 # define QT_BEGIN_NAMESPACE inline namespace QT_NAMESPACE {
0115 # define QT_END_NAMESPACE }
0116 # define QT_BEGIN_INCLUDE_NAMESPACE }
0117 # define QT_END_INCLUDE_NAMESPACE inline namespace QT_NAMESPACE {
0118 # define QT_FORWARD_DECLARE_CLASS(name) \
0119 QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE
0120 
0121 # define QT_FORWARD_DECLARE_STRUCT(name) \
0122 QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE
0123 
0124 inline namespace QT_NAMESPACE {}
0125 
0126 #else /* user namespace */
0127 
0128 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
0129 # define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
0130 # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
0131 # define QT_END_NAMESPACE }
0132 # define QT_BEGIN_INCLUDE_NAMESPACE }
0133 # define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
0134 # define QT_FORWARD_DECLARE_CLASS(name) \
0135     QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \
0136     using QT_PREPEND_NAMESPACE(name);
0137 
0138 # define QT_FORWARD_DECLARE_STRUCT(name) \
0139     QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \
0140     using QT_PREPEND_NAMESPACE(name);
0141 
0142 namespace QT_NAMESPACE {}
0143 
0144 # ifndef QT_BOOTSTRAPPED
0145 # ifndef QT_NO_USING_NAMESPACE
0146    /*
0147     This expands to a "using QT_NAMESPACE" also in _header files_.
0148     It is the only way the feature can be used without too much
0149     pain, but if people _really_ do not want it they can add
0150     QT_NO_USING_NAMESPACE to their build configuration.
0151     */
0152    QT_USE_NAMESPACE
0153 # endif
0154 # endif
0155 
0156 #endif /* user namespace */
0157 
0158 #else /* __cplusplus */
0159 
0160 # define QT_BEGIN_NAMESPACE
0161 # define QT_END_NAMESPACE
0162 # define QT_USE_NAMESPACE
0163 # define QT_BEGIN_INCLUDE_NAMESPACE
0164 # define QT_END_INCLUDE_NAMESPACE
0165 
0166 #endif /* __cplusplus */
0167 
0168 /* ### Qt 6.9 (or later): remove *_MOC_* macros (moc does not need them since 6.5) */
0169 #ifndef QT_BEGIN_MOC_NAMESPACE
0170 # define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
0171 #endif
0172 #ifndef QT_END_MOC_NAMESPACE
0173 # define QT_END_MOC_NAMESPACE
0174 #endif
0175 
0176 /*
0177     Strict mode
0178 */
0179 #ifdef QT_ENABLE_STRICT_MODE_UP_TO
0180 #ifndef QT_DISABLE_DEPRECATED_UP_TO
0181 #  define QT_DISABLE_DEPRECATED_UP_TO QT_ENABLE_STRICT_MODE_UP_TO
0182 #endif
0183 
0184 #if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 0, 0)
0185 # ifndef QT_NO_FOREACH
0186 #  define QT_NO_FOREACH
0187 # endif
0188 # ifndef QT_NO_CAST_TO_ASCII
0189 #  define QT_NO_CAST_TO_ASCII
0190 # endif
0191 # ifndef QT_NO_CAST_FROM_BYTEARRAY
0192 #  define QT_NO_CAST_FROM_BYTEARRAY
0193 # endif
0194 # ifndef QT_NO_URL_CAST_FROM_STRING
0195 #  define QT_NO_URL_CAST_FROM_STRING
0196 # endif
0197 # ifndef QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
0198 #  define QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
0199 # endif
0200 # ifndef QT_NO_JAVA_STYLE_ITERATORS
0201 #  define QT_NO_JAVA_STYLE_ITERATORS
0202 # endif
0203 #endif // 6.0.0
0204 
0205 #if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 6, 0)
0206 # ifndef QT_NO_QEXCHANGE
0207 #  define QT_NO_QEXCHANGE
0208 # endif
0209 #endif // 6.6.0
0210 
0211 #if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 7, 0)
0212 # ifndef QT_NO_CONTEXTLESS_CONNECT
0213 #  define QT_NO_CONTEXTLESS_CONNECT
0214 # endif
0215 #endif // 6.7.0
0216 
0217 #if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 8, 0)
0218 # ifndef QT_NO_QASCONST
0219 #  define QT_NO_QASCONST
0220 # endif
0221 #  if !defined(QT_USE_NODISCARD_FILE_OPEN) && !defined(QT_NO_USE_NODISCARD_FILE_OPEN)
0222 #    define QT_USE_NODISCARD_FILE_OPEN
0223 #  endif
0224 #endif // 6.8.0
0225 
0226 #if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 9, 0)
0227 # ifndef QT_NO_QSNPRINTF
0228 #  define QT_NO_QSNPRINTF
0229 # endif
0230 #endif // 6.9.0
0231 #endif // QT_ENABLE_STRICT_MODE_UP_TO
0232 
0233 #endif /* QTCONFIGMACROS_H */