Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtCore/qtconfigmacros.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 
0013 #include <assert.h>
0014 
0015 /*
0016    The Qt modules' export macros.
0017    The options are:
0018     - defined(QT_STATIC): Qt was built or is being built in static mode
0019     - defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
0020    If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
0021    mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
0022    for the bootstrapped tools.
0023 */
0024 
0025 #ifdef QT_BOOTSTRAPPED
0026 #  ifdef QT_SHARED
0027 #    error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
0028 #  elif !defined(QT_STATIC)
0029 #    define QT_STATIC
0030 #  endif
0031 #endif
0032 
0033 #if defined(QT_SHARED) || !defined(QT_STATIC)
0034 #  ifdef QT_STATIC
0035 #    error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
0036 #  endif
0037 #  ifndef QT_SHARED
0038 #    define QT_SHARED
0039 #  endif
0040 #endif
0041 
0042 /*
0043    No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
0044    for Qt's internal unit tests. If you want slower loading times and more
0045    symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
0046 
0047    \note After adding Q_AUTOTEST_EXPORT to a method, you'll need to wrap any unittests
0048    that will use that method in "#ifdef QT_BUILD_INTERNAL".
0049 */
0050 #if defined(QT_BUILD_INTERNAL) && defined(QT_BUILDING_QT) && defined(QT_SHARED)
0051 #    define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
0052 #elif defined(QT_BUILD_INTERNAL) && defined(QT_SHARED)
0053 #    define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
0054 #else
0055 #    define Q_AUTOTEST_EXPORT
0056 #endif
0057 
0058 /*
0059     The QT_CONFIG macro implements a safe compile time check for features of Qt.
0060     Features can be in three states:
0061         0 or undefined: This will lead to a compile error when testing for it
0062         -1: The feature is not available
0063         1: The feature is available
0064 */
0065 #define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
0066 #define QT_REQUIRE_CONFIG(feature) static_assert(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
0067 
0068 /* moc compats (signals/slots) */
0069 #ifndef QT_MOC_COMPAT
0070 #  define QT_MOC_COMPAT
0071 #else
0072 #  undef QT_MOC_COMPAT
0073 #  define QT_MOC_COMPAT
0074 #endif
0075 
0076 /*
0077    Debugging and error handling
0078 */
0079 
0080 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
0081 #  define QT_DEBUG
0082 #endif
0083 
0084 // valid for both C and C++
0085 #define QT_MANGLE_NAMESPACE0(x) x
0086 #define QT_MANGLE_NAMESPACE1(a, b) a##_##b
0087 #define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
0088 #if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
0089 # define QT_MANGLE_NAMESPACE(name) name
0090 #else
0091 # define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2( \
0092         QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
0093 #endif
0094 
0095 #ifdef __cplusplus
0096 
0097 #if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
0098 
0099 # define QT_PREPEND_NAMESPACE(name) ::name
0100 # define QT_USE_NAMESPACE
0101 # define QT_BEGIN_NAMESPACE
0102 # define QT_END_NAMESPACE
0103 # define QT_BEGIN_INCLUDE_NAMESPACE
0104 # define QT_END_INCLUDE_NAMESPACE
0105 # define QT_FORWARD_DECLARE_CLASS(name) class name;
0106 # define QT_FORWARD_DECLARE_STRUCT(name) struct name;
0107 
0108 #else /* user namespace */
0109 
0110 # define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
0111 # define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
0112 # define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
0113 # define QT_END_NAMESPACE }
0114 # define QT_BEGIN_INCLUDE_NAMESPACE }
0115 # define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
0116 # define QT_FORWARD_DECLARE_CLASS(name) \
0117     QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE \
0118     using QT_PREPEND_NAMESPACE(name);
0119 
0120 # define QT_FORWARD_DECLARE_STRUCT(name) \
0121     QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE \
0122     using QT_PREPEND_NAMESPACE(name);
0123 
0124 namespace QT_NAMESPACE {}
0125 
0126 # ifndef QT_BOOTSTRAPPED
0127 # ifndef QT_NO_USING_NAMESPACE
0128    /*
0129     This expands to a "using QT_NAMESPACE" also in _header files_.
0130     It is the only way the feature can be used without too much
0131     pain, but if people _really_ do not want it they can add
0132     QT_NO_USING_NAMESPACE to their build configuration.
0133     */
0134    QT_USE_NAMESPACE
0135 # endif
0136 # endif
0137 
0138 #endif /* user namespace */
0139 
0140 #else /* __cplusplus */
0141 
0142 # define QT_BEGIN_NAMESPACE
0143 # define QT_END_NAMESPACE
0144 # define QT_USE_NAMESPACE
0145 # define QT_BEGIN_INCLUDE_NAMESPACE
0146 # define QT_END_INCLUDE_NAMESPACE
0147 
0148 #endif /* __cplusplus */
0149 
0150 /* ### Qt 6.9 (or later): remove *_MOC_* macros (moc does not need them since 6.5) */
0151 #ifndef QT_BEGIN_MOC_NAMESPACE
0152 # define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
0153 #endif
0154 #ifndef QT_END_MOC_NAMESPACE
0155 # define QT_END_MOC_NAMESPACE
0156 #endif
0157 
0158 #endif /* QTCONFIGMACROS_H */