Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtconfigmacros.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QTCONFIGMACROS_H
6#define QTCONFIGMACROS_H
7
8#if 0
9# pragma qt_sync_stop_processing
10#endif
11
12#include <QtCore/qtconfiginclude.h>
13#include <QtCore/qtdeprecationdefinitions.h>
14#include <QtCore/qtversionchecks.h>
15
16#include <assert.h>
17
18/*
19 The Qt modules' export macros.
20 The options are:
21 - defined(QT_STATIC): Qt was built or is being built in static mode
22 - defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
23 If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
24 mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
25 for the bootstrapped tools.
26*/
27
28#ifdef QT_BOOTSTRAPPED
29# ifdef QT_SHARED
30# error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
31# elif !defined(QT_STATIC)
32# define QT_STATIC
33# endif
34#endif
35
36#if defined(QT_SHARED) || !defined(QT_STATIC)
37# ifdef QT_STATIC
38# error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
39# endif
40# ifndef QT_SHARED
41# define QT_SHARED
42# endif
43#endif
44
45/*
46 No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
47 for Qt's internal unit tests. If you want slower loading times and more
48 symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
49
50 \note After adding Q_AUTOTEST_EXPORT to a method, you'll need to wrap any unittests
51 that will use that method in "#ifdef QT_BUILD_INTERNAL".
52*/
53#if defined(QT_BUILD_INTERNAL) && defined(QT_BUILDING_QT) && defined(QT_SHARED)
54# define Q_AUTOTEST_EXPORT Q_DECL_EXPORT
55#elif defined(QT_BUILD_INTERNAL) && defined(QT_SHARED)
56# define Q_AUTOTEST_EXPORT Q_DECL_IMPORT
57#else
58# define Q_AUTOTEST_EXPORT
59#endif
60
61/*
62 The QT_CONFIG macro implements a safe compile time check for features of Qt.
63 Features can be in three states:
64 0 or undefined: This will lead to a compile error when testing for it
65 -1: The feature is not available
66 1: The feature is available
67*/
68#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
69#define QT_REQUIRE_CONFIG(feature) static_assert(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
70
71/* moc compats (signals/slots) */
72#ifndef QT_MOC_COMPAT
73# define QT_MOC_COMPAT
74#else
75# undef QT_MOC_COMPAT
76# define QT_MOC_COMPAT
77#endif
78
79/*
80 Debugging and error handling
81*/
82
83#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
84# define QT_DEBUG
85#endif
86
87// valid for both C and C++
88#define QT_MANGLE_NAMESPACE0(x) x
89#define QT_MANGLE_NAMESPACE1(a, b) a##_##b
90#define QT_MANGLE_NAMESPACE2(a, b) QT_MANGLE_NAMESPACE1(a,b)
91#if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
92# define QT_MANGLE_NAMESPACE(name) name
93#else
94# define QT_MANGLE_NAMESPACE(name) QT_MANGLE_NAMESPACE2(
95 QT_MANGLE_NAMESPACE0(name), QT_MANGLE_NAMESPACE0(QT_NAMESPACE))
96#endif
97
98#ifdef __cplusplus
99
100#if !defined(QT_NAMESPACE) || defined(Q_MOC_RUN) /* user namespace */
101
102# define QT_PREPEND_NAMESPACE(name) ::name
103# define QT_USE_NAMESPACE
104# define QT_BEGIN_NAMESPACE
105# define QT_END_NAMESPACE
106# define QT_BEGIN_INCLUDE_NAMESPACE
107# define QT_END_INCLUDE_NAMESPACE
108# define QT_FORWARD_DECLARE_CLASS(name) class name;
109# define QT_FORWARD_DECLARE_STRUCT(name) struct name;
110
111#elif defined(QT_INLINE_NAMESPACE) /* user inline namespace FIXME in Qt 7: Default */
112
113# define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
114# define QT_USE_NAMESPACE
115# define QT_BEGIN_NAMESPACE inline namespace QT_NAMESPACE {
116# define QT_END_NAMESPACE }
117# define QT_BEGIN_INCLUDE_NAMESPACE }
118# define QT_END_INCLUDE_NAMESPACE inline namespace QT_NAMESPACE {
119# define QT_FORWARD_DECLARE_CLASS(name) QT_BEGIN_NAMESPACE
120 class name; QT_END_NAMESPACE
121
122# define QT_FORWARD_DECLARE_STRUCT(name) QT_BEGIN_NAMESPACE
123 struct name; QT_END_NAMESPACE
124
125inline namespace QT_NAMESPACE {}
126
127#else /* user namespace */
128
129# define QT_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
130# define QT_USE_NAMESPACE using namespace ::QT_NAMESPACE;
131# define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
132# define QT_END_NAMESPACE }
133# define QT_BEGIN_INCLUDE_NAMESPACE }
134# define QT_END_INCLUDE_NAMESPACE namespace QT_NAMESPACE {
135# define QT_FORWARD_DECLARE_CLASS(name)
136 QT_BEGIN_NAMESPACE class name; QT_END_NAMESPACE
137 using QT_PREPEND_NAMESPACE(name);
138
139# define QT_FORWARD_DECLARE_STRUCT(name)
140 QT_BEGIN_NAMESPACE struct name; QT_END_NAMESPACE
141 using QT_PREPEND_NAMESPACE(name);
142
143namespace QT_NAMESPACE {}
144
145# ifndef QT_BOOTSTRAPPED
146# ifndef QT_NO_USING_NAMESPACE
147 /*
148 This expands to a "using QT_NAMESPACE" also in _header files_.
149 It is the only way the feature can be used without too much
150 pain, but if people _really_ do not want it they can add
151 QT_NO_USING_NAMESPACE to their build configuration.
152 */
153 QT_USE_NAMESPACE
154# endif
155# endif
156
157#endif /* user namespace */
158
159#else /* __cplusplus */
160
161# define QT_BEGIN_NAMESPACE
162# define QT_END_NAMESPACE
163# define QT_USE_NAMESPACE
164# define QT_BEGIN_INCLUDE_NAMESPACE
165# define QT_END_INCLUDE_NAMESPACE
166
167#endif /* __cplusplus */
168
169/* ### Qt 6.9 (or later): remove *_MOC_* macros (moc does not need them since 6.5) */
170#ifndef QT_BEGIN_MOC_NAMESPACE
171# define QT_BEGIN_MOC_NAMESPACE QT_USE_NAMESPACE
172#endif
173#ifndef QT_END_MOC_NAMESPACE
174# define QT_END_MOC_NAMESPACE
175#endif
176
177/*
178 Strict mode.
179
180 If you add a macro to the list, make sure to update the table at
181 https://doc.qt.io/qt-6/qtglobal.html#QT_ENABLE_STRICT_MODE_UP_TO
182*/
183#ifdef QT_ENABLE_STRICT_MODE_UP_TO
184#ifndef QT_DISABLE_DEPRECATED_UP_TO
185# define QT_DISABLE_DEPRECATED_UP_TO QT_ENABLE_STRICT_MODE_UP_TO
186#endif
187
188//
189// Add new versions _here_, newest first!
190//
191
192#if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 12, 0)
193# ifndef QT_LEAN_HEADERS
194# define QT_LEAN_HEADERS 2
195# endif
196# ifndef QT_NO_DISCONNECT_CONST_CONNECTION
197# define QT_NO_DISCONNECT_CONST_CONNECTION
198# endif
199# ifndef QT_NO_QPAIR
200# define QT_NO_QPAIR
201# endif
202# ifndef QT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD
203# define QT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD
204# endif
205#endif // 6.12.0
206
207#if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 0, 0)
208# ifndef QT_NO_FOREACH
209# define QT_NO_FOREACH
210# endif
211# ifndef QT_NO_CAST_TO_ASCII
212# define QT_NO_CAST_TO_ASCII
213# endif
214# ifndef QT_NO_CAST_FROM_BYTEARRAY
215# define QT_NO_CAST_FROM_BYTEARRAY
216# endif
217# ifndef QT_NO_URL_CAST_FROM_STRING
218# define QT_NO_URL_CAST_FROM_STRING
219# endif
220# ifndef QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
221# define QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
222# endif
223# ifndef QT_NO_JAVA_STYLE_ITERATORS
224# define QT_NO_JAVA_STYLE_ITERATORS
225# endif
226#endif // 6.0.0
227
228#if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 6, 0)
229# ifndef QT_NO_QEXCHANGE
230# define QT_NO_QEXCHANGE
231# endif
232#endif // 6.6.0
233
234#if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 7, 0)
235# ifndef QT_NO_CONTEXTLESS_CONNECT
236# define QT_NO_CONTEXTLESS_CONNECT
237# endif
238#endif // 6.7.0
239
240#if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 8, 0)
241# ifndef QT_NO_QASCONST
242# define QT_NO_QASCONST
243# endif
244# if !defined(QT_USE_NODISCARD_FILE_OPEN) && !defined(QT_NO_USE_NODISCARD_FILE_OPEN)
245# define QT_USE_NODISCARD_FILE_OPEN
246# endif
247#endif // 6.8.0
248
249#if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 9, 0)
250# ifndef QT_NO_QSNPRINTF
251# define QT_NO_QSNPRINTF
252# endif
253#endif // 6.9.0
254
255//
256// newer versions are added newest-first at the _front_!
257//
258
259#endif // QT_ENABLE_STRICT_MODE_UP_TO
260
261#endif /* QTCONFIGMACROS_H */
constexpr AVScore operator""_avscore(unsigned long long arg)
int writeQIODevice(void *opaque, AvioWriteBufferType buf, int buf_size)
constexpr AVScore BestAVScore
constexpr AVScore operator+(AVScore a, int b)
constexpr AVScore & operator-=(AVScore &a, int b)
std::variant< AVPixelFormat, AVSampleFormat > PixelOrSampleFormat
constexpr AVScore operator-(const AVScore &d)
constexpr AVScore operator+(int a, AVScore b)
constexpr AVScore DefaultAVScore
constexpr AVScore & operator+=(AVScore &a, int b)
constexpr AVScore operator-(int a, AVScore b)
constexpr AVScore operator-(AVScore a, AVScore b)
constexpr AVScore NotSuitableAVScore
AVChannelLayout ChannelLayoutT
QDebug operator<<(QDebug dbg, AVScore score)
constexpr AVScore MinAVScore
constexpr AVScore operator-(AVScore a, int b)
#define AV_PROFILE_HEVC_MAIN
#define AV_PROFILE_H264_HIGH
#define QT_FFMPEG_HAS_SWS_FLAGS_ENUM
#define QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
#define QT_SHARED
#define QT_USE_NAMESPACE
#define QT_MANGLE_NAMESPACE1(a, b)
#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE