Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-03 09:25:05

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