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
qcompilerdetection.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#if 0
6#pragma qt_class(QtCompilerDetection)
7#pragma qt_sync_skip_header_check
8#pragma qt_sync_stop_processing
9#endif
10
11#ifndef QCOMPILERDETECTION_H
12#define QCOMPILERDETECTION_H
13
14#include <QtCore/qprocessordetection.h>
15#include <QtCore/qsystemdetection.h>
16#include <QtCore/qtconfiginclude.h>
17
18/*
19 The compiler, must be one of: (Q_CC_x)
20
21 COVERITY - Coverity cov-scan
22 SYM - Digital Mars C/C++ (used to be Symantec C++)
23 MSVC - Microsoft Visual C/C++, Intel C++ for Windows
24 BOR - Borland/Turbo C++
25 WAT - Watcom C++
26 GNU - GNU C++
27 COMEAU - Comeau C++
28 EDG - Edison Design Group C++
29 OC - CenterLine C++
30 SUN - Forte Developer, or Sun Studio C++
31 MIPS - MIPSpro C++
32 DEC - DEC C++
33 HPACC - HP aC++
34 USLC - SCO OUDK and UDK
35 CDS - Reliant C++
36 KAI - KAI C++
37 INTEL - Intel C++ for Linux, Intel C++ for Windows
38 HIGHC - MetaWare High C/C++
39 PGI - Portland Group C++
40 GHS - Green Hills Optimizing C++ Compilers
41 RVCT - ARM Realview Compiler Suite
42 CLANG - C++ front-end for the LLVM compiler
43
44
45 Should be sorted most to least authoritative.
46*/
47
48#if defined(__COVERITY__)
49# define Q_CC_COVERITY
50# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
51#endif
52
53/* Symantec C++ is now Digital Mars */
54#if defined(__DMC__) || defined(__SC__)
55# define Q_CC_SYM
56/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
57# if defined(__SC__) && __SC__ < 0x750
58# error "Compiler not supported"
59# endif
60
61#elif defined(_MSC_VER)
62# define Q_CC_MSVC (_MSC_VER)
63# define Q_CC_MSVC_NET
64# define Q_CC_MSVC_ONLY Q_CC_MSVC
65# ifdef __clang__
66# undef Q_CC_MSVC_ONLY
67# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
68# define Q_CC_CLANG_ONLY Q_CC_CLANG
69# endif
70# define Q_OUTOFLINE_TEMPLATE inline
71# define Q_COMPILER_MANGLES_RETURN_TYPE
72# define Q_COMPILER_MANGLES_ACCESS_SPECIFIER
73# define Q_FUNC_INFO __FUNCSIG__
74# define Q_ASSUME_IMPL(expr) __assume(expr)
75# define Q_UNREACHABLE_IMPL() __assume(0)
76# define Q_DECL_EXPORT __declspec(dllexport)
77# define Q_DECL_IMPORT __declspec(dllimport)
78# if _MSC_VER < 1938 // stdext is deprecated since VS 2022 17.8
79# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500
80# endif
81# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
82
83#elif defined(__BORLANDC__) || defined(__TURBOC__)
84# define Q_CC_BOR
85# define Q_INLINE_TEMPLATE
86# if __BORLANDC__ < 0x502
87# error "Compiler not supported"
88# endif
89
90#elif defined(__WATCOMC__)
91# define Q_CC_WAT
92
93/* ARM Realview Compiler Suite
94 RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
95 so check for it before that */
96#elif defined(__ARMCC__) || defined(__CC_ARM)
97# define Q_CC_RVCT
98/* work-around for missing compiler intrinsics */
99# define __is_empty(X) false
100# define __is_pod(X) false
101# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
102# ifdef Q_OS_LINUX
103# define Q_DECL_EXPORT __attribute__((visibility("default")))
104# define Q_DECL_IMPORT __attribute__((visibility("default")))
105# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
106# else
107# define Q_DECL_EXPORT __declspec(dllexport)
108# define Q_DECL_IMPORT __declspec(dllimport)
109# endif
110
111#elif defined(__GNUC__)
112# define Q_CC_GNU (__GNUC__ * 100 + __GNUC_MINOR__)
113# if defined(__MINGW32__)
114# define Q_CC_MINGW
115# endif
116# if defined(__clang__)
117/* Clang also masquerades as GCC */
118# if defined(__apple_build_version__)
119 // The Clang version reported by Apple Clang in __clang_major__
120 // and __clang_minor__ does _not_ reflect the actual upstream
121 // version of the compiler. To allow consumers to use a single
122 // define to verify the Clang version we hard-code the versions
123 // based on the best available info we have about the actual
124 // version: http://en.wikipedia.org/wiki/Xcode#Toolchain_Versions
125# if __apple_build_version__ >= 14030022 // Xcode 14.3
126# define Q_CC_CLANG 1500
127# elif __apple_build_version__ >= 14000029 // Xcode 14.0
128# define Q_CC_CLANG 1400
129# elif __apple_build_version__ >= 13160021 // Xcode 13.3
130# define Q_CC_CLANG 1300
131# elif __apple_build_version__ >= 13000029 // Xcode 13.0
132# define Q_CC_CLANG 1200
133# elif __apple_build_version__ >= 12050022 // Xcode 12.5
134# define Q_CC_CLANG 1110
135# elif __apple_build_version__ >= 12000032 // Xcode 12.0
136# define Q_CC_CLANG 1000
137# elif __apple_build_version__ >= 11030032 // Xcode 11.4
138# define Q_CC_CLANG 900
139# elif __apple_build_version__ >= 11000033 // Xcode 11.0
140# define Q_CC_CLANG 800
141# else
142# error "Unsupported Apple Clang version"
143# endif
144# else
145 // Non-Apple Clang, so we trust the versions reported
146# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
147# endif
148# define Q_CC_CLANG_ONLY Q_CC_CLANG
149# if __has_builtin(__builtin_assume)
150# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
151# else
152# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
153# endif
154# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
155# if !defined(__has_extension)
156# /* Compatibility with older Clang versions */
157# define __has_extension __has_feature
158# endif
159# if defined(__APPLE__)
160 /* Apple/clang specific features */
161# define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
162# ifdef __OBJC__
163# define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
164# endif
165# endif
166# ifdef __EMSCRIPTEN__
167# define Q_CC_EMSCRIPTEN
168# endif
169# else
170/* Plain GCC */
171# define Q_CC_GNU_ONLY Q_CC_GNU
172# if Q_CC_GNU >= 405
173# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
174# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
175# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
176# endif
177# endif
178
179# ifdef Q_OS_WIN
180# define Q_DECL_EXPORT __declspec(dllexport)
181# define Q_DECL_IMPORT __declspec(dllimport)
182# else
183# define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
184# ifdef QT_USE_PROTECTED_VISIBILITY
185# define Q_DECL_EXPORT __attribute__((visibility("protected")))
186# else
187# define Q_DECL_EXPORT __attribute__((visibility("default")))
188# endif
189# define Q_DECL_IMPORT __attribute__((visibility("default")))
190# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
191# endif
192
193# define Q_FUNC_INFO __PRETTY_FUNCTION__
194# define Q_TYPEOF(expr) __typeof__(expr)
195# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
196# define Q_DECL_UNUSED __attribute__((__unused__))
197# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
198# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
199# define Q_NORETURN __attribute__((__noreturn__))
200# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
201# define Q_DECL_PURE_FUNCTION __attribute__((pure))
202# define Q_DECL_CONST_FUNCTION __attribute__((const))
203# define Q_DECL_COLD_FUNCTION __attribute__((cold))
204# if !defined(QT_MOC_CPP)
205# define Q_PACKED __attribute__ ((__packed__))
206# ifndef __ARM_EABI__
207# define QT_NO_ARM_EABI
208# endif
209# endif
210# if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG)
211# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
212# endif
213
214/* IBM compiler versions are a bit messy. There are actually two products:
215 the C product, and the C++ product. The C++ compiler is always packaged
216 with the latest version of the C compiler. Version numbers do not always
217 match. This little table (I'm not sure it's accurate) should be helpful:
218
219 C++ product C product
220
221 C Set 3.1 C Compiler 3.0
222 ... ...
223 C++ Compiler 3.6.6 C Compiler 4.3
224 ... ...
225 Visual Age C++ 4.0 ...
226 ... ...
227 Visual Age C++ 5.0 C Compiler 5.0
228 ... ...
229 Visual Age C++ 6.0 C Compiler 6.0
230
231 Now:
232 __xlC__ is the version of the C compiler in hexadecimal notation
233 is only an approximation of the C++ compiler version
234 __IBMCPP__ is the version of the C++ compiler in decimal notation
235 but it is not defined on older compilers like C Set 3.1 */
236#elif defined(__xlC__)
237# define Q_CC_XLC
238# if __xlC__ < 0x400
239# error "Compiler not supported"
240# elif __xlC__ >= 0x0600
241# define Q_TYPEOF(expr) __typeof__(expr)
242# define Q_PACKED __attribute__((__packed__))
243# endif
244
245/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed
246 on DEC C++ V5.5-004. New versions do define __EDG__ - observed on
247 Compaq C++ V6.3-002.
248 This compiler is different enough from other EDG compilers to handle
249 it separately anyway. */
250#elif defined(__DECCXX) || defined(__DECC)
251# define Q_CC_DEC
252/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
253 DEC C++ V5 compilers. */
254# if defined(__EDG__)
255# define Q_CC_EDG
256# endif
257/* Compaq has disabled EDG's _BOOL macro and uses _BOOL_EXISTS instead
258 - observed on Compaq C++ V6.3-002.
259 In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
260# if !defined(_BOOL_EXISTS)
261# error "Compiler not supported"
262# endif
263/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
264/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
265 DEC C++ V5.5-004. */
266# if __DECCXX_VER < 60060000
267# define Q_BROKEN_TEMPLATE_SPECIALIZATION
268# endif
269/* avoid undefined symbol problems with out-of-line template members */
270# define Q_OUTOFLINE_TEMPLATE inline
271
272/* The Portland Group C++ compiler is based on EDG and does define __EDG__
273 but the C compiler does not */
274#elif defined(__PGI)
275# define Q_CC_PGI
276# if defined(__EDG__)
277# define Q_CC_EDG
278# endif
279
280/* Compilers with EDG front end are similar. To detect them we test:
281 __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
282 __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002
283 and PGI C++ 5.2-4 */
284#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
285# define Q_CC_EDG
286/* From the EDG documentation (does not seem to apply to Compaq C++ or GHS C):
287 _BOOL
288 Defined in C++ mode when bool is a keyword. The name of this
289 predefined macro is specified by a configuration flag. _BOOL
290 is the default.
291 __BOOL_DEFINED
292 Defined in Microsoft C++ mode when bool is a keyword. */
293# if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
294# error "Compiler not supported"
295# endif
296
297/* The Comeau compiler is based on EDG and does define __EDG__ */
298# if defined(__COMO__)
299# define Q_CC_COMEAU
300
301/* The `using' keyword was introduced to avoid KAI C++ warnings
302 but it's now causing KAI C++ errors instead. The standard is
303 unclear about the use of this keyword, and in practice every
304 compiler is using its own set of rules. Forget it. */
305# elif defined(__KCC)
306# define Q_CC_KAI
307
308/* Uses CFront, make sure to read the manual how to tweak templates. */
309# elif defined(__ghs)
310# define Q_CC_GHS
311# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
312# define Q_PACKED __attribute__ ((__packed__))
313# define Q_FUNC_INFO __PRETTY_FUNCTION__
314# define Q_TYPEOF(expr) __typeof__(expr)
315# define Q_UNREACHABLE_IMPL()
316# if defined(__cplusplus)
317# define Q_COMPILER_AUTO_TYPE
318# define Q_COMPILER_STATIC_ASSERT
319# define Q_COMPILER_RANGE_FOR
320# if __GHS_VERSION_NUMBER >= 201505
321# define Q_COMPILER_ALIGNAS
322# define Q_COMPILER_ALIGNOF
323# define Q_COMPILER_ATOMICS
324# define Q_COMPILER_ATTRIBUTES
325# define Q_COMPILER_AUTO_FUNCTION
326# define Q_COMPILER_CLASS_ENUM
327# define Q_COMPILER_DECLTYPE
328# define Q_COMPILER_DEFAULT_MEMBERS
329# define Q_COMPILER_DELETE_MEMBERS
330# define Q_COMPILER_DELEGATING_CONSTRUCTORS
331# define Q_COMPILER_EXPLICIT_CONVERSIONS
332# define Q_COMPILER_EXPLICIT_OVERRIDES
333# define Q_COMPILER_EXTERN_TEMPLATES
334# define Q_COMPILER_INHERITING_CONSTRUCTORS
335# define Q_COMPILER_INITIALIZER_LISTS
336# define Q_COMPILER_LAMBDA
337# define Q_COMPILER_NONSTATIC_MEMBER_INIT
338# define Q_COMPILER_NOEXCEPT
339# define Q_COMPILER_NULLPTR
340# define Q_COMPILER_RANGE_FOR
341# define Q_COMPILER_RAW_STRINGS
342# define Q_COMPILER_REF_QUALIFIERS
343# define Q_COMPILER_RVALUE_REFS
344# define Q_COMPILER_STATIC_ASSERT
345# define Q_COMPILER_TEMPLATE_ALIAS
346# define Q_COMPILER_THREAD_LOCAL
347# define Q_COMPILER_UDL
348# define Q_COMPILER_UNICODE_STRINGS
349# define Q_COMPILER_UNIFORM_INIT
350# define Q_COMPILER_UNRESTRICTED_UNIONS
351# define Q_COMPILER_VARIADIC_MACROS
352# define Q_COMPILER_VARIADIC_TEMPLATES
353# endif
354# endif //__cplusplus
355
356# elif defined(__DCC__)
357# define Q_CC_DIAB
358# if !defined(__bool)
359# error "Compiler not supported"
360# endif
361
362/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
363# elif defined(__USLC__) && defined(__SCO_VERSION__)
364# define Q_CC_USLC
365/* The latest UDK 7.1.1b does not need this, but previous versions do */
366# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
367# define Q_OUTOFLINE_TEMPLATE inline
368# endif
369
370/* Never tested! */
371# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
372# define Q_CC_OC
373
374/* CDS++ defines __EDG__ although this is not documented in the Reliant
375 documentation. It also follows conventions like _BOOL and this documented */
376# elif defined(sinix)
377# define Q_CC_CDS
378# endif
379
380/* VxWorks' DIAB toolchain has an additional EDG type C++ compiler
381 (see __DCC__ above). This one is for C mode files (__EDG is not defined) */
382#elif defined(_DIAB_TOOL)
383# define Q_CC_DIAB
384# define Q_FUNC_INFO __PRETTY_FUNCTION__
385
386/* Never tested! */
387#elif defined(__HIGHC__)
388# define Q_CC_HIGHC
389
390#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
391# define Q_CC_SUN
392# define Q_COMPILER_MANGLES_RETURN_TYPE
393/* 5.0 compiler or better
394 'bool' is enabled by default but can be disabled using -features=nobool
395 in which case _BOOL is not defined
396 this is the default in 4.2 compatibility mode triggered by -compat=4 */
397# if __SUNPRO_CC >= 0x500
398# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
399 /* see http://developers.sun.com/sunstudio/support/Ccompare.html */
400# if __SUNPRO_CC >= 0x590
401# define Q_TYPEOF(expr) __typeof__(expr)
402# endif
403# if __SUNPRO_CC >= 0x550
404# define Q_DECL_EXPORT __global
405# endif
406# if !defined(_BOOL)
407# error "Compiler not supported"
408# endif
409/* 4.2 compiler or older */
410# else
411# error "Compiler not supported"
412# endif
413
414/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
415 documentation but nevertheless uses EDG conventions like _BOOL */
416#elif defined(sinix)
417# define Q_CC_EDG
418# define Q_CC_CDS
419# if !defined(_BOOL)
420# error "Compiler not supported"
421# endif
422# define Q_BROKEN_TEMPLATE_SPECIALIZATION
423
424#else
425# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
426#endif
427
428/*
429 * SG10's SD-6 feature detection and some useful extensions from Clang and GCC
430 * https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
431 * http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros
432 * Not using wrapper macros, per http://eel.is/c++draft/cpp.cond#7.sentence-2
433 */
434#ifndef __has_builtin
435# define __has_builtin(x) 0
436#endif
437#ifndef __has_feature
438# define __has_feature(x) 0
439#endif
440#ifndef __has_attribute
441# define __has_attribute(x) 0
442#endif
444# define __has_cpp_attribute(x) 0
445#endif
446#ifndef __has_include
447# define __has_include(x) 0
448#endif
449#ifndef __has_include_next
450# define __has_include_next(x) 0
451#endif
452
453/*
454 detecting ASAN can be helpful to disable slow tests
455 clang uses feature, gcc defines __SANITIZE_ADDRESS__
456 unconditionally check both in case other compilers mirror
457 either of those options
458 */
459#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
460# define QT_ASAN_ENABLED
461#endif
462
463#ifdef __cplusplus
464# if __has_include(<version>) /* remove this check once Integrity, QNX have caught up */
465# include <version>
466# endif
467#endif
468
469/*
470 * C++11 support
471 *
472 * Paper Macro SD-6 macro
473 * N2341 Q_COMPILER_ALIGNAS
474 * N2341 Q_COMPILER_ALIGNOF
475 * N2427 Q_COMPILER_ATOMICS
476 * N2761 Q_COMPILER_ATTRIBUTES __cpp_attributes = 200809
477 * N2541 Q_COMPILER_AUTO_FUNCTION
478 * N1984 N2546 Q_COMPILER_AUTO_TYPE
479 * N2437 Q_COMPILER_CLASS_ENUM
480 * N2235 Q_COMPILER_CONSTEXPR __cpp_constexpr = 200704
481 * N2343 N3276 Q_COMPILER_DECLTYPE __cpp_decltype = 200707
482 * N2346 Q_COMPILER_DEFAULT_MEMBERS
483 * N2346 Q_COMPILER_DELETE_MEMBERS
484 * N1986 Q_COMPILER_DELEGATING_CONSTRUCTORS
485 * N2437 Q_COMPILER_EXPLICIT_CONVERSIONS
486 * N3206 N3272 Q_COMPILER_EXPLICIT_OVERRIDES
487 * N1987 Q_COMPILER_EXTERN_TEMPLATES
488 * N2540 Q_COMPILER_INHERITING_CONSTRUCTORS
489 * N2672 Q_COMPILER_INITIALIZER_LISTS
490 * N2658 N2927 Q_COMPILER_LAMBDA __cpp_lambdas = 200907
491 * N2756 Q_COMPILER_NONSTATIC_MEMBER_INIT
492 * N2855 N3050 Q_COMPILER_NOEXCEPT
493 * N2431 Q_COMPILER_NULLPTR
494 * N2930 Q_COMPILER_RANGE_FOR
495 * N2442 Q_COMPILER_RAW_STRINGS __cpp_raw_strings = 200710
496 * N2439 Q_COMPILER_REF_QUALIFIERS
497 * N2118 N2844 N3053 Q_COMPILER_RVALUE_REFS __cpp_rvalue_references = 200610
498 * N1720 Q_COMPILER_STATIC_ASSERT __cpp_static_assert = 200410
499 * N2258 Q_COMPILER_TEMPLATE_ALIAS
500 * N2659 Q_COMPILER_THREAD_LOCAL
501 * N2660 Q_COMPILER_THREADSAFE_STATICS
502 * N2765 Q_COMPILER_UDL __cpp_user_defined_literals = 200809
503 * N2442 Q_COMPILER_UNICODE_STRINGS __cpp_unicode_literals = 200710
504 * N2640 Q_COMPILER_UNIFORM_INIT
505 * N2544 Q_COMPILER_UNRESTRICTED_UNIONS
506 * N1653 Q_COMPILER_VARIADIC_MACROS
507 * N2242 N2555 Q_COMPILER_VARIADIC_TEMPLATES __cpp_variadic_templates = 200704
508 *
509 *
510 * For the C++ standards C++14 and C++17, we use only the SD-6 macro.
511 *
512 * For any future version of the C++ standard, we use only the C++20 feature test macro.
513 * For library features, we assume <version> is present (this header includes it).
514 *
515 * For a full listing of feature test macros, see
516 * https://en.cppreference.com/w/cpp/feature_test
517 * Exceptions:
518 * Q_DECL_CONSTEXPR_DTOR constexpr in C++20 for explicit destructors __cpp_constexpr >= 201907L
519 * Q_CONSTEXPR_DTOR constexpr in C++20 for variables __cpp_constexpr >= 201907L otherwise const
520 * Q_DECL_EQ_DELETE_X(message) = delete("reason"), __cpp_deleted_function >= 202403L
521 *
522 * C++ extensions:
523 * Q_COMPILER_RESTRICTED_VLA variable-length arrays, prior to __cpp_runtime_arrays
524 */
525
526/*
527 * Now that we require C++17, we unconditionally expect threadsafe statics mandated since C++11
528 */
529#define Q_COMPILER_THREADSAFE_STATICS
530
531#if defined(Q_CC_CLANG)
532/* General C++ features */
533# define Q_COMPILER_RESTRICTED_VLA
534# if __has_feature(attribute_deprecated_with_message)
535# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
536# endif
537
538// Clang supports binary literals in C, C++98 and C++11 modes
539// It's been supported "since the dawn of time itself" (cf. commit 179883)
540# if __has_extension(cxx_binary_literals)
541# define Q_COMPILER_BINARY_LITERALS
542# endif
543
544// Variadic macros are supported for gnu++98, c++11, c99 ... since 2.9
545# if Q_CC_CLANG >= 209
546# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
547 || (defined(__cplusplus) && (__cplusplus >= 201103L))
548 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
549# define Q_COMPILER_VARIADIC_MACROS
550# endif
551# endif
552
553/* C++11 features, see http://clang.llvm.org/cxx_status.html */
554# if (defined(__cplusplus) && __cplusplus >= 201103L)
555 || defined(__GXX_EXPERIMENTAL_CXX0X__)
556 /* Detect C++ features using __has_feature(), see http://clang.llvm.org/docs/LanguageExtensions.html#cxx11 */
557# if __has_feature(cxx_alignas)
558# define Q_COMPILER_ALIGNAS
559# define Q_COMPILER_ALIGNOF
560# endif
561# if __has_feature(cxx_atomic) && __has_include(<atomic>)
562# define Q_COMPILER_ATOMICS
563# endif
564# if __has_feature(cxx_attributes)
565# define Q_COMPILER_ATTRIBUTES
566# endif
567# if __has_feature(cxx_auto_type)
568# define Q_COMPILER_AUTO_FUNCTION
569# define Q_COMPILER_AUTO_TYPE
570# endif
571# if __has_feature(cxx_strong_enums)
572# define Q_COMPILER_CLASS_ENUM
573# endif
574# if __has_feature(cxx_constexpr) && Q_CC_CLANG > 302 /* CLANG 3.2 has bad/partial support */
575# define Q_COMPILER_CONSTEXPR
576# endif
577# if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */
578# define Q_COMPILER_DECLTYPE
579# endif
580# if __has_feature(cxx_defaulted_functions)
581# define Q_COMPILER_DEFAULT_MEMBERS
582# endif
583# if __has_feature(cxx_deleted_functions)
584# define Q_COMPILER_DELETE_MEMBERS
585# endif
586# if __has_feature(cxx_delegating_constructors)
587# define Q_COMPILER_DELEGATING_CONSTRUCTORS
588# endif
589# if __has_feature(cxx_explicit_conversions)
590# define Q_COMPILER_EXPLICIT_CONVERSIONS
591# endif
592# if __has_feature(cxx_override_control)
593# define Q_COMPILER_EXPLICIT_OVERRIDES
594# endif
595# if __has_feature(cxx_inheriting_constructors)
596# define Q_COMPILER_INHERITING_CONSTRUCTORS
597# endif
598# if __has_feature(cxx_generalized_initializers)
599# define Q_COMPILER_INITIALIZER_LISTS
600# define Q_COMPILER_UNIFORM_INIT /* both covered by this feature macro, according to docs */
601# endif
602# if __has_feature(cxx_lambdas)
603# define Q_COMPILER_LAMBDA
604# endif
605# if __has_feature(cxx_noexcept)
606# define Q_COMPILER_NOEXCEPT
607# endif
608# if __has_feature(cxx_nonstatic_member_init)
609# define Q_COMPILER_NONSTATIC_MEMBER_INIT
610# endif
611# if __has_feature(cxx_nullptr)
612# define Q_COMPILER_NULLPTR
613# endif
614# if __has_feature(cxx_range_for)
615# define Q_COMPILER_RANGE_FOR
616# endif
617# if __has_feature(cxx_raw_string_literals)
618# define Q_COMPILER_RAW_STRINGS
619# endif
620# if __has_feature(cxx_reference_qualified_functions)
621# define Q_COMPILER_REF_QUALIFIERS
622# endif
623# if __has_feature(cxx_rvalue_references)
624# define Q_COMPILER_RVALUE_REFS
625# endif
626# if __has_feature(cxx_static_assert)
627# define Q_COMPILER_STATIC_ASSERT
628# endif
629# if __has_feature(cxx_alias_templates)
630# define Q_COMPILER_TEMPLATE_ALIAS
631# endif
632# if __has_feature(cxx_thread_local)
633# if !defined(__FreeBSD__) /* FreeBSD clang fails on __cxa_thread_atexit */
634# define Q_COMPILER_THREAD_LOCAL
635# endif
636# endif
637# if __has_feature(cxx_user_literals)
638# define Q_COMPILER_UDL
639# endif
640# if __has_feature(cxx_unicode_literals)
641# define Q_COMPILER_UNICODE_STRINGS
642# endif
643# if __has_feature(cxx_unrestricted_unions)
644# define Q_COMPILER_UNRESTRICTED_UNIONS
645# endif
646# if __has_feature(cxx_variadic_templates)
647# define Q_COMPILER_VARIADIC_TEMPLATES
648# endif
649 /* Features that have no __has_feature() check */
650# if Q_CC_CLANG >= 209 /* since clang 2.9 */
651# define Q_COMPILER_EXTERN_TEMPLATES
652# endif
653# endif // (defined(__cplusplus) && __cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
654
655/* C++1y features, deprecated macros. Do not update this list. */
656# if defined(__cplusplus) && __cplusplus > 201103L
657//# if __has_feature(cxx_binary_literals)
658//# define Q_COMPILER_BINARY_LITERALS // see above
659//# endif
660# if __has_feature(cxx_generic_lambda)
661# define Q_COMPILER_GENERIC_LAMBDA
662# endif
663# if __has_feature(cxx_init_capture)
664# define Q_COMPILER_LAMBDA_CAPTURES
665# endif
666# if __has_feature(cxx_relaxed_constexpr)
667# define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
668# endif
669# if __has_feature(cxx_decltype_auto) && __has_feature(cxx_return_type_deduction)
670# define Q_COMPILER_RETURN_TYPE_DEDUCTION
671# endif
672# if __has_feature(cxx_variable_templates)
673# define Q_COMPILER_VARIABLE_TEMPLATES
674# endif
675# if __has_feature(cxx_runtime_array)
676# define Q_COMPILER_VLA
677# endif
678# endif // if defined(__cplusplus) && __cplusplus > 201103L
679
680# if defined(__STDC_VERSION__)
681# if __has_feature(c_static_assert)
682# define Q_COMPILER_STATIC_ASSERT
683# endif
684# if __has_feature(c_thread_local) && __has_include(<threads.h>)
685# if !defined(__FreeBSD__) /* FreeBSD clang fails on __cxa_thread_atexit */
686# define Q_COMPILER_THREAD_LOCAL
687# endif
688# endif
689# endif
690
691# ifndef Q_DECL_UNUSED
692# define Q_DECL_UNUSED __attribute__((__unused__))
693# endif
694# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
695#endif // defined(Q_CC_CLANG)
696
697#if defined(Q_CC_GNU_ONLY)
698# define Q_COMPILER_RESTRICTED_VLA
699# if Q_CC_GNU >= 403
700// GCC supports binary literals in C, C++98 and C++11 modes
701# define Q_COMPILER_BINARY_LITERALS
702# endif
703# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
704 || (defined(__cplusplus) && (__cplusplus >= 201103L))
705 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
706 // Variadic macros are supported for gnu++98, c++11, C99 ... since forever (gcc 2.97)
707# define Q_COMPILER_VARIADIC_MACROS
708# endif
709# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
710# if Q_CC_GNU >= 403
711 /* C++11 features supported in GCC 4.3: */
712# define Q_COMPILER_DECLTYPE
713# define Q_COMPILER_RVALUE_REFS
714# define Q_COMPILER_STATIC_ASSERT
715# endif
716# if Q_CC_GNU >= 404
717 /* C++11 features supported in GCC 4.4: */
718# define Q_COMPILER_AUTO_FUNCTION
719# define Q_COMPILER_AUTO_TYPE
720# define Q_COMPILER_EXTERN_TEMPLATES
721# define Q_COMPILER_UNIFORM_INIT
722# define Q_COMPILER_UNICODE_STRINGS
723# define Q_COMPILER_VARIADIC_TEMPLATES
724# endif
725# if Q_CC_GNU >= 405
726 /* C++11 features supported in GCC 4.5: */
727# define Q_COMPILER_EXPLICIT_CONVERSIONS
728 /* GCC 4.4 implements initializer_list but does not define typedefs required
729 * by the standard. */
730# define Q_COMPILER_INITIALIZER_LISTS
731# define Q_COMPILER_LAMBDA
732# define Q_COMPILER_RAW_STRINGS
733# define Q_COMPILER_CLASS_ENUM
734# endif
735# if Q_CC_GNU >= 406
736 /* Pre-4.6 compilers implement a non-final snapshot of N2346, hence default and delete
737 * functions are supported only if they are public. Starting from 4.6, GCC handles
738 * final version - the access modifier is not relevant. */
739# define Q_COMPILER_DEFAULT_MEMBERS
740# define Q_COMPILER_DELETE_MEMBERS
741 /* C++11 features supported in GCC 4.6: */
742# define Q_COMPILER_NULLPTR
743# define Q_COMPILER_UNRESTRICTED_UNIONS
744# define Q_COMPILER_RANGE_FOR
745# endif
746# if Q_CC_GNU >= 407
747 /* GCC 4.4 implemented <atomic> and std::atomic using its old intrinsics.
748 * However, the implementation is incomplete for most platforms until GCC 4.7:
749 * instead, std::atomic would use an external lock. Since we need an std::atomic
750 * that is behavior-compatible with QBasicAtomic, we only enable it here */
751# define Q_COMPILER_ATOMICS
752 /* GCC 4.6.x has problems dealing with noexcept expressions,
753 * so turn the feature on for 4.7 and above, only */
754# define Q_COMPILER_NOEXCEPT
755 /* C++11 features supported in GCC 4.7: */
756# define Q_COMPILER_NONSTATIC_MEMBER_INIT
757# define Q_COMPILER_DELEGATING_CONSTRUCTORS
758# define Q_COMPILER_EXPLICIT_OVERRIDES
759# define Q_COMPILER_TEMPLATE_ALIAS
760# define Q_COMPILER_UDL
761# endif
762# if Q_CC_GNU >= 408
763# define Q_COMPILER_ATTRIBUTES
764# define Q_COMPILER_ALIGNAS
765# define Q_COMPILER_ALIGNOF
766# define Q_COMPILER_INHERITING_CONSTRUCTORS
767# define Q_COMPILER_THREAD_LOCAL
768# if Q_CC_GNU > 408 || __GNUC_PATCHLEVEL__ >= 1
769# define Q_COMPILER_REF_QUALIFIERS
770# endif
771# endif
772# if Q_CC_GNU >= 500
773 /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole
774 * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */
775# define Q_COMPILER_CONSTEXPR
776# endif
777# endif
778# if __cplusplus > 201103L
779# if Q_CC_GNU >= 409
780 /* C++1y features in GCC 4.9 - deprecated, do not update this list */
781//# define Q_COMPILER_BINARY_LITERALS // already supported since GCC 4.3 as an extension
782# define Q_COMPILER_LAMBDA_CAPTURES
783# define Q_COMPILER_RETURN_TYPE_DEDUCTION
784# endif
785# endif
786# if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
787# if Q_CC_GNU >= 407
788 /* C11 features supported in GCC 4.7: */
789# define Q_COMPILER_STATIC_ASSERT
790# endif
791# if Q_CC_GNU >= 409 && defined(__has_include)
792 /* C11 features supported in GCC 4.9: */
793# if __has_include(<threads.h>)
794# define Q_COMPILER_THREAD_LOCAL
795# endif
796# endif
797# endif
798#endif
799
800#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
801# if defined(__cplusplus)
802 /* C++11 features supported in VC8 = VC2005: */
803# define Q_COMPILER_VARIADIC_MACROS
804
805 /* 2005 supports the override and final contextual keywords, in
806 the same positions as the C++11 variants, but 'final' is
807 called 'sealed' instead:
808 http://msdn.microsoft.com/en-us/library/0w2w91tf%28v=vs.80%29.aspx
809 The behavior is slightly different in C++/CLI, which requires the
810 "virtual" keyword to be present too, so don't define for that.
811 So don't define Q_COMPILER_EXPLICIT_OVERRIDES (since it's not
812 the same as the C++11 version), but define the Q_DECL_* flags
813 accordingly. */
814 /* C++11 features supported in VC10 = VC2010: */
815# define Q_COMPILER_AUTO_FUNCTION
816# define Q_COMPILER_AUTO_TYPE
817# define Q_COMPILER_DECLTYPE
818# define Q_COMPILER_EXTERN_TEMPLATES
819# define Q_COMPILER_LAMBDA
820# define Q_COMPILER_NULLPTR
821# define Q_COMPILER_RVALUE_REFS
822# define Q_COMPILER_STATIC_ASSERT
823 /* C++11 features supported in VC11 = VC2012: */
824# define Q_COMPILER_EXPLICIT_OVERRIDES /* ...and use std C++11 now */
825# define Q_COMPILER_CLASS_ENUM
826# define Q_COMPILER_ATOMICS
827 /* C++11 features in VC12 = VC2013 */
828# define Q_COMPILER_DELETE_MEMBERS
829# define Q_COMPILER_DELEGATING_CONSTRUCTORS
830# define Q_COMPILER_EXPLICIT_CONVERSIONS
831# define Q_COMPILER_NONSTATIC_MEMBER_INIT
832# define Q_COMPILER_RAW_STRINGS
833# define Q_COMPILER_TEMPLATE_ALIAS
834# define Q_COMPILER_VARIADIC_TEMPLATES
835# define Q_COMPILER_INITIALIZER_LISTS // VC 12 SP 2 RC
836 /* C++11 features in VC14 = VC2015 */
837# define Q_COMPILER_DEFAULT_MEMBERS
838# define Q_COMPILER_ALIGNAS
839# define Q_COMPILER_ALIGNOF
840# define Q_COMPILER_INHERITING_CONSTRUCTORS
841# define Q_COMPILER_NOEXCEPT
842# define Q_COMPILER_RANGE_FOR
843# define Q_COMPILER_REF_QUALIFIERS
844# define Q_COMPILER_THREAD_LOCAL
845# define Q_COMPILER_UDL
846# define Q_COMPILER_UNICODE_STRINGS
847# define Q_COMPILER_UNRESTRICTED_UNIONS
848# if _MSC_FULL_VER >= 190023419
849# define Q_COMPILER_ATTRIBUTES
850// Almost working, see https://connect.microsoft.com/VisualStudio/feedback/details/2011648
851//# define Q_COMPILER_CONSTEXPR
852# define Q_COMPILER_UNIFORM_INIT
853# endif
854# if _MSC_VER >= 1910
855# define Q_COMPILER_CONSTEXPR
856# endif
857// MSVC versions before 19.36 have a bug in C++20 comparison implementation.
858// This leads to ambiguities when resolving comparison operator overloads in
859// certain scenarios (the buggy MSVC versions were checked using our CI and
860// compiler explorer).
861# if _MSC_VER < 1936
862# define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
863# endif
864// QTBUG-124376: MSVC is slow at compiling qstrnlen()
865# define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
866# endif /* __cplusplus */
867#endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
868
869#ifdef Q_COMPILER_UNICODE_STRINGS
870# define Q_STDLIB_UNICODE_STRINGS
871#elif defined(__cplusplus)
872# error "Qt6 requires Unicode string support in both the compiler and the standard library"
873#endif
874
875#ifdef __cplusplus
876# include <utility>
877# if defined(Q_OS_QNX)
878// By default, QNX 7.0 uses libc++ (from LLVM) and
879// QNX 6.X uses Dinkumware's libcpp. In all versions,
880// it is also possible to use GNU libstdc++.
881
882// For Dinkumware, some features must be disabled
883// (mostly because of library problems).
884// Dinkumware is assumed when __GLIBCXX__ (GNU libstdc++)
885// and _LIBCPP_VERSION (LLVM libc++) are both absent.
886# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
887
888// Older versions of libcpp (QNX 650) do not support C++11 features
889// _HAS_* macros are set to 1 by toolchains that actually include
890// Dinkum C++11 libcpp.
891
892# if !defined(_HAS_CPP0X) || !_HAS_CPP0X
893// Disable C++11 features that depend on library support
894# undef Q_COMPILER_INITIALIZER_LISTS
895# undef Q_COMPILER_RVALUE_REFS
896# undef Q_COMPILER_REF_QUALIFIERS
897# undef Q_COMPILER_NOEXCEPT
898// Disable C++11 library features:
899# undef Q_STDLIB_UNICODE_STRINGS
900# endif // !_HAS_CPP0X
901# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
902# undef Q_COMPILER_NULLPTR
903# endif //!_HAS_NULLPTR_T
904# if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
905// The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min()
906// Disable constexpr support on QNX even if the compiler supports it
907# undef Q_COMPILER_CONSTEXPR
908# endif // !_HAS_CONSTEXPR
909# endif // !__GLIBCXX__ && !_LIBCPP_VERSION
910# endif // Q_OS_QNX
911# if defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
912# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
913// Apple has not updated libstdc++ since 2007, which means it does not have
914// <initializer_list> or std::move. Let's disable these features
915# undef Q_COMPILER_INITIALIZER_LISTS
916# undef Q_COMPILER_RVALUE_REFS
917# undef Q_COMPILER_REF_QUALIFIERS
918// Also disable <atomic>, since it's clearly not there
919# undef Q_COMPILER_ATOMICS
920# endif
921# if defined(__cpp_lib_memory_resource)
922 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000)
923 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000))
924# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17
925# endif
926# endif // defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
927#endif
928
929// Don't break code that is already using Q_COMPILER_DEFAULT_DELETE_MEMBERS
930#if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
931# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
932#endif
933
934/*
935 * Compatibility macros for C++11/14 keywords and expressions.
936 * Don't use in new code and port away whenever you have a chance.
937 */
938#define Q_ALIGNOF(x) alignof(x)
939#define Q_DECL_ALIGN(n) alignas(n)
940#define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
941#ifdef __cplusplus
942# define Q_CONSTEXPR constexpr
943# define Q_DECL_CONSTEXPR constexpr
944# define Q_DECL_EQ_DEFAULT = default
945# define Q_DECL_EQ_DELETE = delete
946# define Q_DECL_FINAL final
947# define Q_DECL_NOEXCEPT noexcept
948# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
949# define Q_DECL_OVERRIDE override
950# define Q_DECL_RELAXED_CONSTEXPR constexpr
951# define Q_NULLPTR nullptr
952# define Q_RELAXED_CONSTEXPR constexpr
953#else
954# define Q_CONSTEXPR const
955# define Q_DECL_CONSTEXPR
956# define Q_DECL_RELAXED_CONSTEXPR
957# define Q_NULLPTR NULL
958# define Q_RELAXED_CONSTEXPR const
959# ifdef Q_CC_GNU
960# define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
961# else
962# define Q_DECL_NOEXCEPT
963# endif
964#endif
965
966#if __has_cpp_attribute(nodiscard) && (!defined(Q_CC_CLANG) || __cplusplus > 201402L) // P0188R1
967// Can't use [[nodiscard]] with Clang and C++11/14, see https://bugs.llvm.org/show_bug.cgi?id=33518
968# undef Q_REQUIRED_RESULT
969# define Q_REQUIRED_RESULT [[nodiscard]]
970#endif
971
972#if __has_cpp_attribute(nodiscard) >= 201907L /* used for both P1771 and P1301... */
973// [[nodiscard]] constructor (P1771)
974# ifndef Q_NODISCARD_CTOR
975# define Q_NODISCARD_CTOR [[nodiscard]]
976# endif
977// [[nodiscard("reason")]] (P1301)
978# ifndef Q_NODISCARD_X
979# define Q_NODISCARD_X(message) [[nodiscard(message)]]
980# endif
981# ifndef Q_NODISCARD_CTOR_X
982# define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
983# endif
984#endif
985
986#if __has_cpp_attribute(maybe_unused)
987# undef Q_DECL_UNUSED
988# define Q_DECL_UNUSED [[maybe_unused]]
989#endif
990
991#if __has_cpp_attribute(noreturn)
992# undef Q_NORETURN
993# define Q_NORETURN [[noreturn]]
994#endif
995
996#if __has_cpp_attribute(deprecated)
997# ifdef Q_DECL_DEPRECATED
998# undef Q_DECL_DEPRECATED
999# endif
1000# ifdef Q_DECL_DEPRECATED_X
1001# undef Q_DECL_DEPRECATED_X
1002# endif
1003# define Q_DECL_DEPRECATED [[deprecated]]
1004# define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
1005#endif
1006
1007#define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
1008#define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
1009
1010#ifndef Q_DECL_CONSTEXPR_DTOR
1011# if __cpp_constexpr >= 201907L
1012# define Q_DECL_CONSTEXPR_DTOR constexpr
1013# else
1014# define Q_DECL_CONSTEXPR_DTOR inline
1015# endif
1016#endif
1017
1018#ifndef Q_CONSTEXPR_DTOR
1019# if __cpp_constexpr >= 201907L
1020# define Q_CONSTEXPR_DTOR constexpr
1021# else
1022# define Q_CONSTEXPR_DTOR const
1023# endif
1024#endif
1025
1026#ifndef Q_DECL_EQ_DELETE_X
1027// Clang advertises the feature-testing macro but issues a warning
1028// if one isn't also using C++26,
1029// https://github.com/llvm/llvm-project/issues/109311
1030# if defined(__cpp_deleted_function) && __cpp_deleted_function >= 202403L
1031 && (!defined(Q_CC_CLANG_ONLY) || __cplusplus > 202302L) // C++26
1032# define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
1033# else
1034# define Q_DECL_EQ_DELETE_X(reason) = delete
1035# endif
1036#endif
1037
1038#ifndef Q_LIKELY_BRANCH
1039# if __has_cpp_attribute(likely)
1040# define Q_LIKELY_BRANCH [[likely]]
1041# define Q_UNLIKELY_BRANCH [[unlikely]]
1042# else
1043# define Q_LIKELY_BRANCH
1044# define Q_UNLIKELY_BRANCH
1045# endif
1046#endif
1047
1048/*
1049 * Fallback macros to certain compiler features
1050 */
1051
1052#ifndef Q_NORETURN
1053# define Q_NORETURN
1054#endif
1055#ifndef Q_LIKELY
1056# define Q_LIKELY(x) (x)
1057#endif
1058#ifndef Q_UNLIKELY
1059# define Q_UNLIKELY(x) (x)
1060#endif
1061#ifndef Q_ASSUME_IMPL
1062# define Q_ASSUME_IMPL(expr) qt_noop()
1063#endif
1064#ifndef Q_UNREACHABLE_IMPL
1065# define Q_UNREACHABLE_IMPL() qt_noop()
1066#endif
1067#ifndef Q_ALLOC_SIZE
1068# define Q_ALLOC_SIZE(x)
1069#endif
1070#ifndef Q_REQUIRED_RESULT
1071# define Q_REQUIRED_RESULT
1072#endif
1073#ifndef Q_NODISCARD_X
1074# define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1075#endif
1076#ifndef Q_NODISCARD_CTOR
1077# define Q_NODISCARD_CTOR
1078#endif
1079#ifndef Q_NODISCARD_CTOR_X
1080# define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1081#endif
1082#ifndef Q_DECL_DEPRECATED
1083# define Q_DECL_DEPRECATED
1084#endif
1085#ifndef Q_DECL_VARIABLE_DEPRECATED
1086# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
1087#endif
1088#ifndef Q_DECL_DEPRECATED_X
1089# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1090#endif
1091#ifndef Q_DECL_EXPORT
1092# define Q_DECL_EXPORT
1093#endif
1095# define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1096#endif
1097#ifndef Q_DECL_IMPORT
1098# define Q_DECL_IMPORT
1099#endif
1100#ifndef Q_DECL_HIDDEN
1101# define Q_DECL_HIDDEN
1102#endif
1103#ifndef Q_DECL_UNUSED
1104# define Q_DECL_UNUSED
1105#endif
1107# define Q_DECL_UNUSED_MEMBER
1108#endif
1109#ifndef Q_FUNC_INFO
1110# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1111# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1112# else
1113# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1114# endif
1115#endif
1116#ifndef Q_DECL_CF_RETURNS_RETAINED
1117# define Q_DECL_CF_RETURNS_RETAINED
1118#endif
1119#ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1120# define Q_DECL_NS_RETURNS_AUTORELEASED
1121#endif
1123# define Q_DECL_PURE_FUNCTION
1124#endif
1126# define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1127#endif
1129# define Q_DECL_COLD_FUNCTION
1130#endif
1131#ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1132# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1133#endif
1134#ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1135# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1136#endif
1137
1138/*
1139 * "Weak overloads" - makes an otherwise confliciting overload weaker
1140 * (by making it a template)
1141 */
1142#ifndef Q_QDOC
1143# define Q_WEAK_OVERLOAD template <typename = void>
1144#else
1145# define Q_WEAK_OVERLOAD
1146#endif
1147
1148/*
1149 * If one wants to add functions that use post-C++17 APIs, one needs to:
1150 *
1151 * 1) make them fully inline; and
1152 * 2) guard them using the necessary feature-testing macros.
1153 *
1154 * This decouples the C++ version used to build Qt with the one used by
1155 * end-user applications; Qt and the application can either choose any C++
1156 * version.
1157 *
1158 * A problem arises on MSVC for member functions of exported classes. Client
1159 * code that tries to use such a function will see it as exported, and simply
1160 * try to consume the function's *symbol*. However, if Qt has been built in
1161 * C++17, it won't have such a symbol, and linking will fail.
1162 *
1163 * The workaround: declare such functions as function templates.
1164 * (Obviously a function template does not need this marker.)
1165*/
1166#ifndef Q_QDOC
1167# define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1168#else
1169# define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1170#endif
1171
1172/*
1173 * Warning/diagnostic handling
1174 */
1175
1176#define QT_DO_PRAGMA(text) _Pragma(#text)
1177#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1178# undef QT_DO_PRAGMA /* not needed */
1179# define QT_WARNING_PUSH __pragma(warning(push))
1180# define QT_WARNING_POP __pragma(warning(pop))
1181# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1182# define QT_WARNING_DISABLE_INTEL(number)
1183# define QT_WARNING_DISABLE_CLANG(text)
1184# define QT_WARNING_DISABLE_GCC(text)
1185# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996)
1186# define QT_WARNING_DISABLE_FLOAT_COMPARE
1187# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1188#elif defined(Q_CC_CLANG)
1189# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1190# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1191# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1192# define QT_WARNING_DISABLE_GCC(text)
1193# define QT_WARNING_DISABLE_INTEL(number)
1194# define QT_WARNING_DISABLE_MSVC(number)
1195# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
1196# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
1197# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_CLANG("-Winvalid-offsetof")
1198#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
1199# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1200# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1201# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1202# define QT_WARNING_DISABLE_CLANG(text)
1203# define QT_WARNING_DISABLE_INTEL(number)
1204# define QT_WARNING_DISABLE_MSVC(number)
1205# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1206# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1207# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1208#else // All other compilers, GCC < 4.6 and MSVC < 2008
1209# define QT_WARNING_DISABLE_GCC(text)
1210# define QT_WARNING_PUSH
1211# define QT_WARNING_POP
1212# define QT_WARNING_DISABLE_INTEL(number)
1213# define QT_WARNING_DISABLE_MSVC(number)
1214# define QT_WARNING_DISABLE_CLANG(text)
1215# define QT_WARNING_DISABLE_GCC(text)
1216# define QT_WARNING_DISABLE_DEPRECATED
1217# define QT_WARNING_DISABLE_FLOAT_COMPARE
1218# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1219#endif
1220
1221#ifndef QT_IGNORE_DEPRECATIONS
1222#define QT_IGNORE_DEPRECATIONS(statement)
1225 statement
1227#endif
1228
1229// The body must be a statement:
1230#define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
1231
1232// This macro can be used to calculate member offsets for types with a non standard layout.
1233// It uses the fact that offsetof() is allowed to support those types since C++17 as an optional
1234// feature. All our compilers do support this, but some issue a warning, so we wrap the offsetof()
1235// call in a macro that disables the compiler warning.
1236#define Q_OFFSETOF(Class, member)
1237 []() -> size_t {
1239 return offsetof(Class, member);
1241 }()
1242
1243/*
1244 Proper for-scoping in MIPSpro CC
1245*/
1246#ifndef QT_NO_KEYWORDS
1247# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1248# define for if (0) {} else for
1249# endif
1250#endif
1251
1252#ifdef Q_COMPILER_RVALUE_REFS
1253#define qMove(x) std::move(x)
1254#else
1255#define qMove(x) (x)
1256#endif
1257
1258#if defined(__cplusplus)
1259#if __has_cpp_attribute(clang::fallthrough)
1260# define Q_FALLTHROUGH() [[clang::fallthrough]]
1261#elif __has_cpp_attribute(gnu::fallthrough)
1262# define Q_FALLTHROUGH() [[gnu::fallthrough]]
1263#elif __has_cpp_attribute(fallthrough)
1264# define Q_FALLTHROUGH() [[fallthrough]]
1265#endif
1266#endif
1267#ifndef Q_FALLTHROUGH
1268# ifdef Q_CC_GNU
1269# define Q_FALLTHROUGH() __attribute__((fallthrough))
1270# else
1271# define Q_FALLTHROUGH() (void)0
1272# endif
1273#endif
1274
1275
1276/*
1277 Sanitize compiler feature availability
1278*/
1279#if !defined(Q_PROCESSOR_X86)
1280# undef QT_COMPILER_SUPPORTS_SSE2
1281# undef QT_COMPILER_SUPPORTS_SSE3
1282# undef QT_COMPILER_SUPPORTS_SSSE3
1283# undef QT_COMPILER_SUPPORTS_SSE4_1
1284# undef QT_COMPILER_SUPPORTS_SSE4_2
1285# undef QT_COMPILER_SUPPORTS_AVX
1286# undef QT_COMPILER_SUPPORTS_AVX2
1287# undef QT_COMPILER_SUPPORTS_F16C
1288#endif
1289#if !defined(Q_PROCESSOR_ARM)
1290# undef QT_COMPILER_SUPPORTS_NEON
1291#endif
1292#if !defined(Q_PROCESSOR_MIPS)
1293# undef QT_COMPILER_SUPPORTS_MIPS_DSP
1294# undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1295#endif
1296
1297// Compiler version check
1298#if defined(__cplusplus) && (__cplusplus < 201703L)
1299# ifdef Q_CC_MSVC
1300# error "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler."
1301# else
1302# error "Qt requires a C++17 compiler"
1303# endif
1304#endif // __cplusplus
1305
1306#if defined(__cplusplus) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1307# if Q_CC_MSVC < 1927
1308 // Check below only works with 16.7 or newer
1309# error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1310# endif
1311
1312// On MSVC we require /permissive- set by user code. Check that we are
1313// under its rules -- for instance, check that std::nullptr_t->bool is
1314// not an implicit conversion, as per
1315// https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-160#nullptr_t-is-only-convertible-to-bool-as-a-direct-initialization
1316static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
1317 "On MSVC you must pass the /permissive- option to the compiler.");
1318#endif
1319
1320#if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__)
1321// this is fine
1322#elif defined(QT_REDUCE_RELOCATIONS)
1323# error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "
1324 "Compile your code with -fPIC (and not with -fPIE)."
1325#endif
1326
1327#ifdef Q_PROCESSOR_X86_32
1328# if defined(Q_CC_GNU)
1329# define QT_FASTCALL __attribute__((regparm(3)))
1330# elif defined(Q_CC_MSVC)
1331# define QT_FASTCALL __fastcall
1332# else
1333# define QT_FASTCALL
1334# endif
1335#else
1336# define QT_FASTCALL
1337#endif
1338
1339// enable gcc warnings for printf-style functions
1340#if defined(Q_CC_GNU) && !defined(__INSURE__)
1341# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
1342# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1343 __attribute__((format(gnu_printf, (A), (B))))
1344# else
1345# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1346 __attribute__((format(printf, (A), (B))))
1347# endif
1348#else
1349# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1350#endif
1351
1352#ifdef Q_CC_MSVC
1353# define Q_NEVER_INLINE __declspec(noinline)
1354# define Q_ALWAYS_INLINE __forceinline
1355#elif defined(Q_CC_GNU)
1356# define Q_NEVER_INLINE __attribute__((noinline))
1357# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
1358#else
1359# define Q_NEVER_INLINE
1360# define Q_ALWAYS_INLINE inline
1361#endif
1362
1363//defines the type for the WNDPROC on windows
1364//the alignment needs to be forced for sse2 to not crash with mingw
1365#if defined(Q_OS_WIN)
1366# if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
1367# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1368# else
1369# define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1370# endif
1371# define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1372#endif
1373
1374#ifdef __cpp_conditional_explicit
1375#define Q_IMPLICIT explicit(false)
1376#else
1377#define Q_IMPLICIT
1378#endif
1379
1380#if defined(__cplusplus)
1381
1382#ifdef __cpp_constinit
1383# if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1384 // https://developercommunity.visualstudio.com/t/C:-constinit-for-an-optional-fails-if-/1406069
1385# define Q_CONSTINIT
1386# else
1387# define Q_CONSTINIT constinit
1388# endif
1389#elif defined(__has_cpp_attribute) && __has_cpp_attribute(clang::require_constant_initialization)
1390# define Q_CONSTINIT [[clang::require_constant_initialization]]
1391#elif defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1000
1392# define Q_CONSTINIT __constinit
1393#else
1394# define Q_CONSTINIT
1395#endif
1396
1397#ifndef Q_OUTOFLINE_TEMPLATE
1398# define Q_OUTOFLINE_TEMPLATE
1399#endif
1400#ifndef Q_INLINE_TEMPLATE
1401# define Q_INLINE_TEMPLATE inline
1402#endif
1403
1404/*
1405 Avoid some particularly useless warnings from some stupid compilers.
1406 To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
1407 the line "#define QT_NO_WARNINGS". See also QTBUG-26877.
1408*/
1409#if !defined(QT_CC_WARNINGS)
1410# define QT_NO_WARNINGS
1411#endif
1412#if defined(QT_NO_WARNINGS)
1413# if defined(Q_CC_MSVC)
1414QT_WARNING_DISABLE_MSVC(4251) /* class 'type' needs to have dll-interface to be used by clients of class 'type2' */
1415QT_WARNING_DISABLE_MSVC(4244) /* conversion from 'type1' to 'type2', possible loss of data */
1416QT_WARNING_DISABLE_MSVC(4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */
1417QT_WARNING_DISABLE_MSVC(4514) /* unreferenced inline function has been removed */
1418QT_WARNING_DISABLE_MSVC(4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
1419QT_WARNING_DISABLE_MSVC(4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
1420QT_WARNING_DISABLE_MSVC(4706) /* assignment within conditional expression */
1421QT_WARNING_DISABLE_MSVC(4355) /* 'this' : used in base member initializer list */
1422QT_WARNING_DISABLE_MSVC(4710) /* function not inlined */
1423QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */
1424# elif defined(Q_CC_BOR)
1425# pragma option -w-inl
1426# pragma option -w-aus
1427# pragma warn -inl
1428# pragma warn -pia
1429# pragma warn -ccc
1430# pragma warn -rch
1431# pragma warn -sig
1432# endif
1433#endif
1434
1435#if !defined(QT_NO_EXCEPTIONS)
1436# if !defined(Q_MOC_RUN)
1437# if defined(Q_CC_GNU) && !defined(__cpp_exceptions)
1438# define QT_NO_EXCEPTIONS
1439# endif
1440# elif defined(QT_BOOTSTRAPPED)
1441# define QT_NO_EXCEPTIONS
1442# endif
1443#endif
1444
1445// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
1446#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
1447# define QT_COMPILER_HAS_LWG3346
1448#endif
1449
1450#if defined(__cplusplus) && __cplusplus >= 202002L // P0846 doesn't have a feature macro :/
1451# if !defined(Q_CC_MSVC_ONLY) || Q_CC_MSVC >= 1939 // claims C++20 support but lacks P0846
1452 // 1939 is known to work
1453 // 1936 is known to fail
1454# define QT_COMPILER_HAS_P0846
1455# endif
1456#endif
1457
1458#ifdef QT_COMPILER_HAS_P0846
1459# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1460#else
1461 class QT_CLASS_JUST_FOR_P0846_SIMULATION;
1462# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1463 template <typename T>
1464 void func (QT_CLASS_JUST_FOR_P0846_SIMULATION *);
1465 /* end */
1466#endif // !P0846
1467
1468#endif // __cplusplus
1469
1470#endif // QCOMPILERDETECTION_H
#define assert
#define Q_NODISCARD_CTOR
#define Q_FALLTHROUGH()
#define __has_include_next(x)
#define Q_NODISCARD_X(message)
#define Q_ASSUME_IMPL(expr)
#define Q_DECL_DEPRECATED_X(text)
#define Q_UNREACHABLE_IMPL()
#define Q_UNLIKELY(x)
#define Q_NORETURN
#define Q_DECL_EXPORT
#define __has_builtin(x)
#define Q_DECL_NOEXCEPT
#define __has_attribute(x)
#define Q_DECL_PURE_FUNCTION
#define Q_DECL_UNUSED
#define Q_DECL_HIDDEN
#define Q_DECL_CONST_FUNCTION
#define QT_WARNING_POP
#define QT_WARNING_DISABLE_DEPRECATED
#define Q_LIKELY(x)
#define Q_DECL_DEPRECATED
#define QT_DO_PRAGMA(text)
#define Q_DECL_COLD_FUNCTION
#define QT_WARNING_DISABLE_GCC(text)
#define QT_WARNING_DISABLE_INVALID_OFFSETOF
#define Q_FUNC_INFO
#define Q_DECL_UNUSED_MEMBER
#define QT_WARNING_PUSH
#define Q_NODISCARD_CTOR_X(message)
#define Q_REQUIRED_RESULT
#define Q_DECL_IMPORT
#define QT_WARNING_DISABLE_CLANG(text)
#define __has_include(x)
#define Q_DECL_EXPORT_OVERRIDABLE
#define __has_cpp_attribute(x)
#define __has_feature(x)
#define QT_FT_MAX_GRAY_SPANS
static int gray_move_to(const QT_FT_Vector *to, PWorker worker)
#define qt_ft_memset
#define qt_ft_setjmp
static void gray_record_cell(RAS_ARG)
#define RAS_ARG
#define QT_FT_MEM_ZERO(dest, count)
#define UPSCALE(x)
#define ErrRaster_Memory_Overflow
static PCell gray_find_cell(RAS_ARG)
struct TCell_ * PCell
long TPos
static void gray_raster_done(QT_FT_Raster raster)
#define TRUNC(x)
static void gray_render_line(RAS_ARG_ TPos to_x, TPos to_y)
#define QT_FT_UNUSED(x)
static int gray_convert_glyph_inner(RAS_ARG)
static void gray_start_cell(RAS_ARG_ TCoord ex, TCoord ey)
#define QT_FT_TRACE5(x)
static void gray_split_conic(QT_FT_Vector *base)
#define ErrRaster_Invalid_Argument
static int gray_raster_new(QT_FT_Raster *araster)
static int QT_FT_Outline_Decompose(const QT_FT_Outline *outline, void *user)
#define QT_FT_DIV_MOD(type, dividend, divisor, quotient, remainder)
#define QT_FT_HYPOT(x, y)
static void gray_render_cubic(RAS_ARG_ const QT_FT_Vector *control1, const QT_FT_Vector *control2, const QT_FT_Vector *to)
#define RAS_VAR
static int gray_convert_glyph(RAS_ARG)
ptrdiff_t QT_FT_PtrDist
#define QT_FT_ERR_XCAT(x, y)
Definition qgrayraster.c:98
static int gray_raster_render(QT_FT_Raster raster, const QT_FT_Raster_Params *params)
#define QT_FT_TRACE7(x)
#define RAS_VAR_
#define PIXEL_BITS
#define FRACT(x)
#define ErrRaster_Invalid_Mode
#define qt_ft_jmp_buf
#define qt_ft_longjmp
#define ras
static void gray_raster_reset(QT_FT_Raster raster, char *pool_base, long pool_size)
int q_gray_rendered_spans(TRaster *raster)
static void gray_compute_cbox(RAS_ARG)
#define RAS_ARG_
#define SCALED(x)
long TArea
static void gray_set_cell(RAS_ARG_ TCoord ex, TCoord ey)
#define ErrRaster_OutOfMemory
const QT_FT_Raster_Funcs qt_ft_grays_raster
#define QT_FT_ERR_CAT(x, y)
Definition qgrayraster.c:99
#define QT_FT_MEM_SET(d, s, c)
static void gray_init_cells(RAS_ARG_ void *buffer, long byte_size)
static void gray_render_conic(RAS_ARG_ const QT_FT_Vector *control, const QT_FT_Vector *to)
static void gray_sweep(RAS_ARG_ const QT_FT_Bitmap *target)
static void gray_render_scanline(RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2)
static void gray_render_span(int count, const QT_FT_Span *spans, PWorker worker)
#define ErrRaster_Invalid_Outline
long TCoord
#define QT_FT_ABS(a)
#define ONE_PIXEL
static void gray_split_cubic(QT_FT_Vector *base)
static void gray_hline(RAS_ARG_ TCoord x, TCoord y, TPos area, int acount)
#define __has_extension(X)
Definition qnumeric_p.h:29
PCell next
int cover
TArea area
long buffer_size
void * buffer
PWorker worker
void * memory
int band_size
long buffer_allocated_size
TPos max_ex
TArea area
qt_ft_jmp_buf jump_buffer
PCell cells
QT_FT_PtrDist max_cells
int band_shoot
QT_FT_Raster_Span_Func render_span
void * buffer
TCoord ex
TPos ycount
TPos max_ey
QT_FT_BBox clip_box
int skip_spans
QT_FT_Span gray_spans[QT_FT_MAX_GRAY_SPANS]
TPos min_ey
long buffer_size
TPos count_ey
QT_FT_PtrDist num_cells
TPos min_ex
void * render_span_data
PCell * ycells
TCoord ey
int num_gray_spans
QT_FT_Outline outline
QT_FT_Bitmap target
int band_size
TPos count_ex