6#pragma qt_class(QtCompilerDetection)
7#pragma qt_sync_skip_header_check
8#pragma qt_sync_stop_processing
11#ifndef QCOMPILERDETECTION_H
12#define QCOMPILERDETECTION_H
14#include <QtCore/qprocessordetection.h>
15#include <QtCore/qsystemdetection.h>
16#include <QtCore/qtconfiginclude.h>
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
48#if defined(__COVERITY__)
50# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
54#if defined(__DMC__) || defined(__SC__)
57# if defined(__SC__) && __SC__ < 0x750
58# error "Compiler not supported"
61#elif defined(_MSC_VER)
62# define Q_CC_MSVC (_MSC_VER)
64# define Q_CC_MSVC_ONLY Q_CC_MSVC
67# define Q_CC_CLANG ((__clang_major__ * 100
) + __clang_minor__)
68# define Q_CC_CLANG_ONLY Q_CC_CLANG
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)
79# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N))
82# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
85#elif defined(__BORLANDC__) || defined(__TURBOC__)
87# define Q_INLINE_TEMPLATE
88# if __BORLANDC__ < 0x502
89# error "Compiler not supported"
92#elif defined(__WATCOMC__)
96
97
98#elif defined(__ARMCC__) || defined(__CC_ARM)
101# define __is_empty(X) false
102# define __is_pod(X) false
103# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
105# define Q_DECL_EXPORT __attribute__((visibility("default")))
106# define Q_DECL_IMPORT __attribute__((visibility("default")))
107# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
109# define Q_DECL_EXPORT __declspec(dllexport)
110# define Q_DECL_IMPORT __declspec(dllimport)
113#elif defined(__GNUC__
)
114# define Q_CC_GNU (__GNUC__
* 100
+ __GNUC_MINOR__
)
115# if defined(__MINGW32__)
118# if defined(__clang__
)
120# if defined(__apple_build_version__)
127# if __apple_build_version__ >= 17000319
128# define Q_CC_CLANG 1915
129# elif __apple_build_version__ >= 17000013
130# define Q_CC_CLANG 1914
131# elif __apple_build_version__ >= 16000026
132# define Q_CC_CLANG 1706
133# elif __apple_build_version__ >= 15000040
134# define Q_CC_CLANG 1600
135# elif __apple_build_version__ >= 14030022
136# define Q_CC_CLANG 1500
137# elif __apple_build_version__ >= 14000029
138# define Q_CC_CLANG 1400
139# elif __apple_build_version__ >= 13160021
140# define Q_CC_CLANG 1300
141# elif __apple_build_version__ >= 13000029
142# define Q_CC_CLANG 1200
143# elif __apple_build_version__ >= 12050022
144# define Q_CC_CLANG 1110
145# elif __apple_build_version__ >= 12000032
146# define Q_CC_CLANG 1000
147# elif __apple_build_version__ >= 11030032
148# define Q_CC_CLANG 900
149# elif __apple_build_version__ >= 11000033
150# define Q_CC_CLANG 800
152# error "Unsupported Apple Clang version"
156# define Q_CC_CLANG ((__clang_major__
* 100
) + __clang_minor__
)
158# define Q_CC_CLANG_ONLY Q_CC_CLANG
160# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
162# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
164# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
167# define __has_extension __has_feature
169# if defined(__APPLE__)
171# define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
173# define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
176# ifdef __EMSCRIPTEN__
177# define Q_CC_EMSCRIPTEN
181# define Q_CC_GNU_ONLY Q_CC_GNU
183# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
184# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
185# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
190# define Q_DECL_EXPORT __declspec(dllexport)
191# define Q_DECL_IMPORT __declspec(dllimport)
193# define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
194# ifdef QT_USE_PROTECTED_VISIBILITY
195# define Q_DECL_EXPORT __attribute__((visibility("protected")))
197# define Q_DECL_EXPORT __attribute__((visibility("default")))
199# define Q_DECL_IMPORT __attribute__((visibility("default")))
200# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
203# define Q_FUNC_INFO __PRETTY_FUNCTION__
204# define Q_TYPEOF(expr) __typeof__(expr)
205# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
206# define Q_DECL_UNUSED __attribute__((__unused__))
207# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
208# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
209# define Q_NORETURN __attribute__((__noreturn__))
210# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
211# define Q_DECL_PURE_FUNCTION __attribute__((pure))
212# define Q_DECL_CONST_FUNCTION __attribute__((const))
213# define Q_DECL_COLD_FUNCTION __attribute__((cold))
214# define Q_PACKED __attribute__ ((__packed__))
216# define QT_NO_ARM_EABI
218# if Q_CC_GNU
>= 403
&& !defined(Q_CC_CLANG
)
219# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244#elif defined(__xlC__)
247# error "Compiler not supported"
248# elif __xlC__ >= 0x0600
249# define Q_TYPEOF(expr) __typeof__(expr)
250# define Q_PACKED __attribute__((__packed__))
254
255
256
257
258#elif defined(__DECCXX) || defined(__DECC)
261
266
267
268# if !defined(_BOOL_EXISTS)
269# error "Compiler not supported"
273
274# if __DECCXX_VER < 60060000
275# define Q_BROKEN_TEMPLATE_SPECIALIZATION
278# define Q_OUTOFLINE_TEMPLATE inline
281
289
290
291
292#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
295
296
297
298
299
300
301# if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
302# error "Compiler not supported"
306# if defined(__COMO__)
310
311
312
319# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
320# define Q_PACKED __attribute__ ((__packed__))
321# define Q_FUNC_INFO __PRETTY_FUNCTION__
322# define Q_TYPEOF(expr) __typeof__(expr)
323# define Q_UNREACHABLE_IMPL()
324# if defined(__cplusplus)
325# define Q_COMPILER_AUTO_TYPE
326# define Q_COMPILER_STATIC_ASSERT
327# define Q_COMPILER_RANGE_FOR
328# if __GHS_VERSION_NUMBER >= 201505
329# define Q_COMPILER_ALIGNAS
330# define Q_COMPILER_ALIGNOF
331# define Q_COMPILER_ATOMICS
332# define Q_COMPILER_ATTRIBUTES
333# define Q_COMPILER_AUTO_FUNCTION
334# define Q_COMPILER_CLASS_ENUM
335# define Q_COMPILER_DECLTYPE
336# define Q_COMPILER_DEFAULT_MEMBERS
337# define Q_COMPILER_DELETE_MEMBERS
338# define Q_COMPILER_DELEGATING_CONSTRUCTORS
339# define Q_COMPILER_EXPLICIT_CONVERSIONS
340# define Q_COMPILER_EXPLICIT_OVERRIDES
341# define Q_COMPILER_EXTERN_TEMPLATES
342# define Q_COMPILER_INHERITING_CONSTRUCTORS
343# define Q_COMPILER_INITIALIZER_LISTS
344# define Q_COMPILER_LAMBDA
345# define Q_COMPILER_NONSTATIC_MEMBER_INIT
346# define Q_COMPILER_NOEXCEPT
347# define Q_COMPILER_NULLPTR
348# define Q_COMPILER_RANGE_FOR
349# define Q_COMPILER_RAW_STRINGS
350# define Q_COMPILER_REF_QUALIFIERS
351# define Q_COMPILER_RVALUE_REFS
352# define Q_COMPILER_STATIC_ASSERT
353# define Q_COMPILER_TEMPLATE_ALIAS
354# define Q_COMPILER_THREAD_LOCAL
355# define Q_COMPILER_UDL
356# define Q_COMPILER_UNICODE_STRINGS
357# define Q_COMPILER_UNIFORM_INIT
358# define Q_COMPILER_UNRESTRICTED_UNIONS
359# define Q_COMPILER_VARIADIC_MACROS
360# define Q_COMPILER_VARIADIC_TEMPLATES
364# elif defined(__DCC__)
367# error "Compiler not supported"
371# elif defined(__USLC__) && defined(__SCO_VERSION__)
374# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010
)
375# define Q_OUTOFLINE_TEMPLATE inline
379# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
383
389
390#elif defined(_DIAB_TOOL)
392# define Q_FUNC_INFO __PRETTY_FUNCTION__
395#elif defined(__HIGHC__)
398#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
400# define Q_COMPILER_MANGLES_RETURN_TYPE
402
403
404
405# if __SUNPRO_CC >= 0x500
406# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
408# if __SUNPRO_CC >= 0x590
409# define Q_TYPEOF(expr) __typeof__(expr)
411# if __SUNPRO_CC >= 0x550
412# define Q_DECL_EXPORT __global
415# error "Compiler not supported"
419# error "Compiler not supported"
423
428# error "Compiler not supported"
430# define Q_BROKEN_TEMPLATE_SPECIALIZATION
433# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
437
438
439
440
441
443# define __has_builtin(x) 0
446# define __has_feature(x) 0
449# define __has_attribute(x) 0
451#ifndef __has_c_attribute
452# define __has_c_attribute(x) 0
455# define __has_cpp_attribute(x) 0
458# define __has_include(x) 0
461# define __has_include_next(x) 0
465
466
467
468
469
470#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
471# define QT_ASAN_ENABLED
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
532
533
534#define Q_COMPILER_THREADSAFE_STATICS
536#if defined(Q_CC_CLANG
)
538# define Q_COMPILER_RESTRICTED_VLA
540# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
546# define Q_COMPILER_BINARY_LITERALS
550# if Q_CC_CLANG
>= 209
551# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__
)
552 || (defined(__cplusplus
) && (__cplusplus
>= 201103L
))
553 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
))
554# define Q_COMPILER_VARIADIC_MACROS
559# if (defined(__cplusplus
) && __cplusplus
>= 201103L
)
560 || defined(__GXX_EXPERIMENTAL_CXX0X__
)
563# define Q_COMPILER_ALIGNAS
564# define Q_COMPILER_ALIGNOF
567# define Q_COMPILER_ATOMICS
570# define Q_COMPILER_ATTRIBUTES
573# define Q_COMPILER_AUTO_FUNCTION
574# define Q_COMPILER_AUTO_TYPE
577# define Q_COMPILER_CLASS_ENUM
580# define Q_COMPILER_CONSTEXPR
583# define Q_COMPILER_DECLTYPE
586# define Q_COMPILER_DEFAULT_MEMBERS
589# define Q_COMPILER_DELETE_MEMBERS
592# define Q_COMPILER_DELEGATING_CONSTRUCTORS
595# define Q_COMPILER_EXPLICIT_CONVERSIONS
598# define Q_COMPILER_EXPLICIT_OVERRIDES
601# define Q_COMPILER_INHERITING_CONSTRUCTORS
604# define Q_COMPILER_INITIALIZER_LISTS
605# define Q_COMPILER_UNIFORM_INIT
608# define Q_COMPILER_LAMBDA
611# define Q_COMPILER_NOEXCEPT
614# define Q_COMPILER_NONSTATIC_MEMBER_INIT
617# define Q_COMPILER_NULLPTR
620# define Q_COMPILER_RANGE_FOR
623# define Q_COMPILER_RAW_STRINGS
626# define Q_COMPILER_REF_QUALIFIERS
629# define Q_COMPILER_RVALUE_REFS
632# define Q_COMPILER_STATIC_ASSERT
635# define Q_COMPILER_TEMPLATE_ALIAS
638# if !defined(__FreeBSD__)
639# define Q_COMPILER_THREAD_LOCAL
643# define Q_COMPILER_UDL
646# define Q_COMPILER_UNICODE_STRINGS
649# define Q_COMPILER_UNRESTRICTED_UNIONS
652# define Q_COMPILER_VARIADIC_TEMPLATES
655# if Q_CC_CLANG
>= 209
656# define Q_COMPILER_EXTERN_TEMPLATES
661# if defined(__cplusplus
) && __cplusplus
> 201103L
666# define Q_COMPILER_GENERIC_LAMBDA
669# define Q_COMPILER_LAMBDA_CAPTURES
672# define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
675# define Q_COMPILER_RETURN_TYPE_DEDUCTION
678# define Q_COMPILER_VARIABLE_TEMPLATES
681# define Q_COMPILER_VLA
685# if defined(__STDC_VERSION__)
686# if __has_feature(c_static_assert)
687# define Q_COMPILER_STATIC_ASSERT
689# if __has_feature(c_thread_local) && __has_include(<threads.h>)
690# if !defined(__FreeBSD__)
691# define Q_COMPILER_THREAD_LOCAL
697# define Q_DECL_UNUSED __attribute__((__unused__))
702#if defined(Q_CC_GNU_ONLY)
703# define Q_COMPILER_RESTRICTED_VLA
706# define Q_COMPILER_BINARY_LITERALS
708# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
709 || (defined(__cplusplus) && (__cplusplus >= 201103L
))
710 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
))
712# define Q_COMPILER_VARIADIC_MACROS
714# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
717# define Q_COMPILER_DECLTYPE
718# define Q_COMPILER_RVALUE_REFS
719# define Q_COMPILER_STATIC_ASSERT
723# define Q_COMPILER_AUTO_FUNCTION
724# define Q_COMPILER_AUTO_TYPE
725# define Q_COMPILER_EXTERN_TEMPLATES
726# define Q_COMPILER_UNIFORM_INIT
727# define Q_COMPILER_UNICODE_STRINGS
728# define Q_COMPILER_VARIADIC_TEMPLATES
732# define Q_COMPILER_EXPLICIT_CONVERSIONS
734
735# define Q_COMPILER_INITIALIZER_LISTS
736# define Q_COMPILER_LAMBDA
737# define Q_COMPILER_RAW_STRINGS
738# define Q_COMPILER_CLASS_ENUM
742
743
744# define Q_COMPILER_DEFAULT_MEMBERS
745# define Q_COMPILER_DELETE_MEMBERS
747# define Q_COMPILER_NULLPTR
748# define Q_COMPILER_UNRESTRICTED_UNIONS
749# define Q_COMPILER_RANGE_FOR
753
754
755
756# define Q_COMPILER_ATOMICS
758
759# define Q_COMPILER_NOEXCEPT
761# define Q_COMPILER_NONSTATIC_MEMBER_INIT
762# define Q_COMPILER_DELEGATING_CONSTRUCTORS
763# define Q_COMPILER_EXPLICIT_OVERRIDES
764# define Q_COMPILER_TEMPLATE_ALIAS
765# define Q_COMPILER_UDL
768# define Q_COMPILER_ATTRIBUTES
769# define Q_COMPILER_ALIGNAS
770# define Q_COMPILER_ALIGNOF
771# define Q_COMPILER_INHERITING_CONSTRUCTORS
772# define Q_COMPILER_THREAD_LOCAL
773# if Q_CC_GNU > 408
|| __GNUC_PATCHLEVEL__ >= 1
774# define Q_COMPILER_REF_QUALIFIERS
779
780# define Q_COMPILER_CONSTEXPR
783# if __cplusplus > 201103L
787# define Q_COMPILER_LAMBDA_CAPTURES
788# define Q_COMPILER_RETURN_TYPE_DEDUCTION
791# if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
794# define Q_COMPILER_STATIC_ASSERT
796# if Q_CC_GNU >= 409
&& defined(__has_include)
798# if __has_include(<threads.h>)
799# define Q_COMPILER_THREAD_LOCAL
805#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
806# if defined(__cplusplus)
808# define Q_COMPILER_VARIADIC_MACROS
811
812
813
814
815
816
817
818
820# define Q_COMPILER_AUTO_FUNCTION
821# define Q_COMPILER_AUTO_TYPE
822# define Q_COMPILER_DECLTYPE
823# define Q_COMPILER_EXTERN_TEMPLATES
824# define Q_COMPILER_LAMBDA
825# define Q_COMPILER_NULLPTR
826# define Q_COMPILER_RVALUE_REFS
827# define Q_COMPILER_STATIC_ASSERT
829# define Q_COMPILER_EXPLICIT_OVERRIDES
830# define Q_COMPILER_CLASS_ENUM
831# define Q_COMPILER_ATOMICS
833# define Q_COMPILER_DELETE_MEMBERS
834# define Q_COMPILER_DELEGATING_CONSTRUCTORS
835# define Q_COMPILER_EXPLICIT_CONVERSIONS
836# define Q_COMPILER_NONSTATIC_MEMBER_INIT
837# define Q_COMPILER_RAW_STRINGS
838# define Q_COMPILER_TEMPLATE_ALIAS
839# define Q_COMPILER_VARIADIC_TEMPLATES
840# define Q_COMPILER_INITIALIZER_LISTS
842# define Q_COMPILER_DEFAULT_MEMBERS
843# define Q_COMPILER_ALIGNAS
844# define Q_COMPILER_ALIGNOF
845# define Q_COMPILER_INHERITING_CONSTRUCTORS
846# define Q_COMPILER_NOEXCEPT
847# define Q_COMPILER_RANGE_FOR
848# define Q_COMPILER_REF_QUALIFIERS
849# define Q_COMPILER_THREAD_LOCAL
850# define Q_COMPILER_UDL
851# define Q_COMPILER_UNICODE_STRINGS
852# define Q_COMPILER_UNRESTRICTED_UNIONS
853# if _MSC_FULL_VER >= 190023419
854# define Q_COMPILER_ATTRIBUTES
857# define Q_COMPILER_UNIFORM_INIT
860# define Q_COMPILER_CONSTEXPR
867# define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
870# define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
874#ifdef Q_COMPILER_UNICODE_STRINGS
875# define Q_STDLIB_UNICODE_STRINGS
876#elif defined(__cplusplus)
877# error "Qt6 requires Unicode string support in both the compiler and the standard library"
882# if defined(Q_OS_QNX)
891# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
897# if !defined(_HAS_CPP0X) || !_HAS_CPP0X
899# undef Q_COMPILER_INITIALIZER_LISTS
900# undef Q_COMPILER_RVALUE_REFS
901# undef Q_COMPILER_REF_QUALIFIERS
902# undef Q_COMPILER_NOEXCEPT
904# undef Q_STDLIB_UNICODE_STRINGS
906# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
907# undef Q_COMPILER_NULLPTR
909# if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
912# undef Q_COMPILER_CONSTEXPR
916# if defined(Q_CC_CLANG
) && defined(Q_OS_DARWIN)
917# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0
) * 100
+ __GNUC_LIBSTD_MINOR__-0
<= 402
)
920# undef Q_COMPILER_INITIALIZER_LISTS
921# undef Q_COMPILER_RVALUE_REFS
922# undef Q_COMPILER_REF_QUALIFIERS
924# undef Q_COMPILER_ATOMICS
926# if defined(__cpp_lib_memory_resource)
927 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000
)
928 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000
))
929# undef __cpp_lib_memory_resource
935#if defined(Q_COMPILER_DEFAULT_MEMBERS
) && defined(Q_COMPILER_DELETE_MEMBERS
)
936# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
940
941
942
943#define Q_ALIGNOF(x) alignof(x)
944#define Q_DECL_ALIGN(n) alignas(n)
947# define Q_CONSTEXPR constexpr
948# define Q_DECL_CONSTEXPR constexpr
949# define Q_DECL_EQ_DEFAULT = default
950# define Q_DECL_EQ_DELETE = delete
951# define Q_DECL_FINAL final
952# define Q_DECL_NOEXCEPT noexcept
953# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
954# define Q_DECL_OVERRIDE override
955# define Q_DECL_RELAXED_CONSTEXPR constexpr
956# define Q_NULLPTR nullptr
957# define Q_RELAXED_CONSTEXPR constexpr
959# define Q_CONSTEXPR const
960# define Q_DECL_CONSTEXPR
961# define Q_DECL_RELAXED_CONSTEXPR
962# define Q_NULLPTR NULL
963# define Q_RELAXED_CONSTEXPR const
965# define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
967# define Q_DECL_NOEXCEPT
973# undef Q_REQUIRED_RESULT
974# define Q_REQUIRED_RESULT [[nodiscard]]
980# ifndef Q_NODISCARD_CTOR
981# define Q_NODISCARD_CTOR [[nodiscard]]
984# ifndef Q_NODISCARD_X
985# define Q_NODISCARD_X(message) [[nodiscard(message)]]
987# ifndef Q_NODISCARD_CTOR_X
988# define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
995# define Q_DECL_UNUSED [[maybe_unused]]
1001# define Q_NORETURN [[noreturn]]
1004#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU
< 1300
1011# undef Q_DECL_DEPRECATED
1014# undef Q_DECL_DEPRECATED_X
1016# define Q_DECL_DEPRECATED [[deprecated]]
1017# define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
1023#ifndef Q_DECL_CONSTEXPR_DTOR
1024# if __cpp_constexpr
>= 201907L
1025# define Q_DECL_CONSTEXPR_DTOR constexpr
1027# define Q_DECL_CONSTEXPR_DTOR inline
1031#ifndef Q_CONSTEXPR_DTOR
1032# if __cpp_constexpr
>= 201907L
1033# define Q_CONSTEXPR_DTOR constexpr
1035# define Q_CONSTEXPR_DTOR const
1039#ifndef Q_DECL_EQ_DELETE_X
1043# if defined(__cpp_deleted_function
) && __cpp_deleted_function
>= 202403L
1044 && (!defined(Q_CC_CLANG_ONLY
) || Q_CC_CLANG_ONLY
>= 2010
|| __cplusplus
> 202302L
)
1045# define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
1047# define Q_DECL_EQ_DELETE_X(reason) = delete
1051#ifndef Q_LIKELY_BRANCH
1053# define Q_LIKELY_BRANCH [[likely]]
1054# define Q_UNLIKELY_BRANCH [[unlikely]]
1056# define Q_LIKELY_BRANCH
1057# define Q_UNLIKELY_BRANCH
1062
1063
1069# define Q_LIKELY(x) (x)
1072# define Q_UNLIKELY(x) (x)
1075# define Q_ASSUME_IMPL(expr) qt_noop()
1078# define Q_UNREACHABLE_IMPL() qt_noop()
1081# define Q_ALLOC_SIZE(x)
1084# define Q_REQUIRED_RESULT
1087# define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1090# define Q_NODISCARD_CTOR
1093# define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1096# define Q_DECL_DEPRECATED
1098#ifndef Q_DECL_VARIABLE_DEPRECATED
1102# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1105# define Q_DECL_EXPORT
1108# define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1111# define Q_DECL_IMPORT
1114# define Q_DECL_HIDDEN
1117# define Q_DECL_UNUSED
1120# define Q_DECL_UNUSED_MEMBER
1123# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1124# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1126# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1129#ifndef Q_DECL_CF_RETURNS_RETAINED
1130# define Q_DECL_CF_RETURNS_RETAINED
1132#ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1133# define Q_DECL_NS_RETURNS_AUTORELEASED
1136# define Q_DECL_PURE_FUNCTION
1139# define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1142# define Q_DECL_COLD_FUNCTION
1144#ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1145# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1147#ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1148# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1152
1153
1154
1156# define Q_WEAK_OVERLOAD template <typename = void>
1158# define Q_WEAK_OVERLOAD
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1180# define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1182# define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1186
1187
1189#define QT_DO_PRAGMA(text) _Pragma(#text)
1190#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
1192# define QT_WARNING_PUSH __pragma(warning(push))
1193# define QT_WARNING_POP __pragma(warning(pop))
1194# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1195# define QT_WARNING_DISABLE_INTEL(number)
1196# define QT_WARNING_DISABLE_CLANG(text)
1197# define QT_WARNING_DISABLE_GCC(text)
1198# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996
)
1199# define QT_WARNING_DISABLE_FLOAT_COMPARE
1200# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1201#elif defined(Q_CC_CLANG
)
1202# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1203# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1204# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1205# define QT_WARNING_DISABLE_GCC(text)
1206# define QT_WARNING_DISABLE_INTEL(number)
1207# define QT_WARNING_DISABLE_MSVC(number)
1211#elif defined(Q_CC_GNU) && (__GNUC__ * 100
+ __GNUC_MINOR__ >= 406
)
1212# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1213# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1214# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1215# define QT_WARNING_DISABLE_CLANG(text)
1216# define QT_WARNING_DISABLE_INTEL(number)
1217# define QT_WARNING_DISABLE_MSVC(number)
1218# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1219# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1220# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1222# define QT_WARNING_DISABLE_GCC(text)
1223# define QT_WARNING_PUSH
1224# define QT_WARNING_POP
1225# define QT_WARNING_DISABLE_INTEL(number)
1226# define QT_WARNING_DISABLE_MSVC(number)
1227# define QT_WARNING_DISABLE_CLANG(text)
1228# define QT_WARNING_DISABLE_GCC(text)
1229# define QT_WARNING_DISABLE_DEPRECATED
1230# define QT_WARNING_DISABLE_FLOAT_COMPARE
1231# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1234#ifndef QT_IGNORE_DEPRECATIONS
1235#define QT_IGNORE_DEPRECATIONS(statement)
1249#define Q_OFFSETOF(Class, member)
1252 return offsetof(Class, member);
1257
1258
1259#ifndef QT_NO_KEYWORDS
1260# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1261# define for if (0
) {} else for
1265#ifdef Q_COMPILER_RVALUE_REFS
1266#define qMove(x) std::move(x)
1271#if defined(__cplusplus
)
1273# define Q_FALLTHROUGH() [[clang::fallthrough]]
1274#elif __has_cpp_attribute(gnu::fallthrough)
1275# define Q_FALLTHROUGH() [[gnu::fallthrough]]
1276#elif __has_cpp_attribute(fallthrough)
1277# define Q_FALLTHROUGH() [[fallthrough]]
1280# if __has_c_attribute(fallthrough)
1281# define Q_FALLTHROUGH() [[fallthrough]]
1286# define Q_FALLTHROUGH() __attribute__((fallthrough))
1288# define Q_FALLTHROUGH() (void)0
1293# define Q_DECL_UNINITIALIZED __attribute__((uninitialized))
1295# define Q_DECL_UNINITIALIZED
1300
1301
1302#if !defined(Q_PROCESSOR_X86)
1303# undef QT_COMPILER_SUPPORTS_SSE2
1304# undef QT_COMPILER_SUPPORTS_SSE3
1305# undef QT_COMPILER_SUPPORTS_SSSE3
1306# undef QT_COMPILER_SUPPORTS_SSE4_1
1307# undef QT_COMPILER_SUPPORTS_SSE4_2
1308# undef QT_COMPILER_SUPPORTS_AVX
1309# undef QT_COMPILER_SUPPORTS_AVX2
1310# undef QT_COMPILER_SUPPORTS_F16C
1312#if !defined(Q_PROCESSOR_ARM)
1313# undef QT_COMPILER_SUPPORTS_NEON
1315#if !defined(Q_PROCESSOR_MIPS)
1316# undef QT_COMPILER_SUPPORTS_MIPS_DSP
1317# undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1321#if defined(__cplusplus
) && (__cplusplus
< 201703L
)
1323# 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."
1325# error "Qt requires a C++17 compiler"
1329#if defined(__cplusplus
) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
1330# if Q_CC_MSVC < 1927
1332# error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1339static_assert(!std::is_convertible_v<std::nullptr_t,
bool>,
1340 "On MSVC you must pass the /permissive- option to the compiler.");
1343#if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__
) || defined(__PIC__
)
1345#elif defined(__PIE__)
1346# error "-fPIE is not sufficient if Qt was configured with the -DFEATURE_reduce_relocations=ON "
1347 "CMake option. Compile your code with -fPIC and without -fPIE or compile Qt with "
1348 "-DFEATURE_no_direct_extern_access=ON."
1349#elif defined(QT_REDUCE_RELOCATIONS)
1350# error "You must build your code with position independent code if Qt was configured with the "
1351 "-DFEATURE_reduce_relocations=ON CMake option. Compile your code with -fPIC and "
1352 "without -fPIE or compile Qt with -DFEATURE_no_direct_extern_access=ON."
1355#ifdef Q_PROCESSOR_X86_32
1356# if defined(Q_CC_GNU)
1357# define QT_FASTCALL __attribute__((regparm(3
)))
1358# elif defined(Q_CC_MSVC)
1359# define QT_FASTCALL __fastcall
1368#if defined(Q_CC_GNU
) && !defined(__INSURE__)
1369# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG
)
1370# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1371 __attribute__((format(gnu_printf, (A), (B))))
1373# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1374 __attribute__((format(printf, (A), (B))))
1377# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1381# define Q_NEVER_INLINE __declspec(noinline)
1382# define Q_ALWAYS_INLINE __forceinline
1383#elif defined(Q_CC_GNU
)
1384# define Q_NEVER_INLINE __attribute__((noinline))
1385# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
1387# define Q_NEVER_INLINE
1388# define Q_ALWAYS_INLINE inline
1393#if defined(Q_OS_WIN)
1394# if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
1395# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1397# define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1399# define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1402#ifdef __cpp_conditional_explicit
1403#define Q_IMPLICIT explicit(false)
1408#if defined(__cplusplus
)
1410#ifdef __cpp_constinit
1411# if defined(Q_CC_MSVC) && _MSC_VER < 1940
&& !defined(Q_CC_CLANG)
1415# define Q_CONSTINIT constinit
1418# define Q_CONSTINIT [[clang::require_constant_initialization]]
1419#elif defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1000
1420# define Q_CONSTINIT __constinit
1425#ifndef Q_OUTOFLINE_TEMPLATE
1426# define Q_OUTOFLINE_TEMPLATE
1428#ifndef Q_INLINE_TEMPLATE
1429# define Q_INLINE_TEMPLATE inline
1433
1434
1435
1436
1437#if !defined(QT_CC_WARNINGS)
1438# define QT_NO_WARNINGS
1440#if defined(QT_NO_WARNINGS
)
1441# if defined(Q_CC_MSVC)
1442QT_WARNING_DISABLE_MSVC(4251)
1443QT_WARNING_DISABLE_MSVC(4244)
1444QT_WARNING_DISABLE_MSVC(4275)
1445QT_WARNING_DISABLE_MSVC(4514)
1446QT_WARNING_DISABLE_MSVC(4800)
1447QT_WARNING_DISABLE_MSVC(4097)
1448QT_WARNING_DISABLE_MSVC(4706)
1449QT_WARNING_DISABLE_MSVC(4355)
1450QT_WARNING_DISABLE_MSVC(4710)
1451QT_WARNING_DISABLE_MSVC(4530)
1452# elif defined(Q_CC_CLANG_ONLY
)
1453# if __has_warning
("-Wcharacter-conversion")
1456# elif defined(Q_CC_BOR)
1457# pragma option -w-inl
1458# pragma option -w-aus
1467#if !defined(QT_NO_EXCEPTIONS)
1468# if !defined(Q_MOC_RUN)
1469# if defined(Q_CC_GNU
) && !defined(__cpp_exceptions
)
1470# define QT_NO_EXCEPTIONS
1472# elif defined(QT_BOOTSTRAPPED)
1473# define QT_NO_EXCEPTIONS
1478#if __cplusplus
>= 202002L
&& (!defined(_GLIBCXX_RELEASE
) || _GLIBCXX_RELEASE
>= 11
)
1479# define QT_COMPILER_HAS_LWG3346
1482#if defined(__cplusplus
) && __cplusplus
>= 202002L
1483# if !defined(Q_CC_MSVC_ONLY) || Q_CC_MSVC >= 1939
1486# define QT_COMPILER_HAS_P0846
1490#ifdef QT_COMPILER_HAS_P0846
1491# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1493 class QT_CLASS_JUST_FOR_P0846_SIMULATION;
1494# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1495 template <typename T>
1496 void func (QT_CLASS_JUST_FOR_P0846_SIMULATION *);
#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 __has_c_attribute(x)
#define __has_attribute(x)
#define Q_DECL_PURE_FUNCTION
#define Q_DECL_CONST_FUNCTION
#define QT_WARNING_DISABLE_DEPRECATED
#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_DECL_UNUSED_MEMBER
#define Q_NODISCARD_CTOR_X(message)
#define Q_REQUIRED_RESULT
#define QT_WARNING_DISABLE_CLANG(text)
#define Q_DECL_EXPORT_OVERRIDABLE
#define __has_cpp_attribute(x)
#define QT_FT_MAX_GRAY_SPANS
static int gray_move_to(const QT_FT_Vector *to, PWorker worker)
static void gray_record_cell(RAS_ARG)
#define QT_FT_MEM_ZERO(dest, count)
#define ErrRaster_Memory_Overflow
static PCell gray_find_cell(RAS_ARG)
static void gray_raster_done(QT_FT_Raster raster)
static void gray_render_line(RAS_ARG_ TPos to_x, TPos to_y)
static int gray_convert_glyph_inner(RAS_ARG)
static void gray_start_cell(RAS_ARG_ TCoord ex, TCoord ey)
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)
static int gray_convert_glyph(RAS_ARG)
#define QT_FT_ERR_XCAT(x, y)
static int gray_raster_render(QT_FT_Raster raster, const QT_FT_Raster_Params *params)
#define ErrRaster_Invalid_Mode
static void gray_raster_reset(QT_FT_Raster raster, char *pool_base, long pool_size)
static void gray_compute_cbox(RAS_ARG)
static void gray_set_cell(RAS_ARG_ TCoord ex, TCoord ey)
#define ErrRaster_OutOfMemory
#define QT_FT_ERR_CAT(x, y)
#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
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)
#define QT_MANGLE_NAMESPACE(name)
long buffer_allocated_size
qt_ft_jmp_buf jump_buffer
QT_FT_Raster_Span_Func render_span
QT_FT_Span gray_spans[QT_FT_MAX_GRAY_SPANS]