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