7#pragma qt_class(QtCompilerDetection)
8#pragma qt_sync_skip_header_check
9#pragma qt_sync_stop_processing
12#ifndef QCOMPILERDETECTION_H
13#define QCOMPILERDETECTION_H
15#include <QtCore/qprocessordetection.h>
16#include <QtCore/qsystemdetection.h>
17#include <QtCore/qtconfiginclude.h>
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
47
49#if defined(__COVERITY__)
51# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
55#if defined(__DMC__) || defined(__SC__)
58# if defined(__SC__) && __SC__ < 0x750
59# error "Compiler not supported"
62#elif defined(_MSC_VER)
63# define Q_CC_MSVC (_MSC_VER)
65# define Q_CC_MSVC_ONLY Q_CC_MSVC
68# define Q_CC_CLANG ((__clang_major__ * 100
) + __clang_minor__)
69# define Q_CC_CLANG_ONLY Q_CC_CLANG
71# define Q_OUTOFLINE_TEMPLATE inline
72# define Q_COMPILER_MANGLES_RETURN_TYPE
73# define Q_COMPILER_MANGLES_ACCESS_SPECIFIER
74# define Q_FUNC_INFO __FUNCSIG__
75# define Q_ASSUME_IMPL(expr) __assume(expr)
76# define Q_UNREACHABLE_IMPL() __assume(0
)
77# define Q_DECL_EXPORT __declspec(dllexport)
78# define Q_DECL_IMPORT __declspec(dllimport)
80# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N))
83# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
86#elif defined(__BORLANDC__) || defined(__TURBOC__)
88# define Q_INLINE_TEMPLATE
89# if __BORLANDC__ < 0x502
90# error "Compiler not supported"
93#elif defined(__WATCOMC__)
97
98
99#elif defined(__ARMCC__) || defined(__CC_ARM)
102# define __is_empty(X) false
103# define __is_pod(X) false
104# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
106# define Q_DECL_EXPORT __attribute__((visibility("default")))
107# define Q_DECL_IMPORT __attribute__((visibility("default")))
108# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
110# define Q_DECL_EXPORT __declspec(dllexport)
111# define Q_DECL_IMPORT __declspec(dllimport)
114#elif defined(__GNUC__
)
115# define Q_CC_GNU (__GNUC__
* 100
+ __GNUC_MINOR__
)
116# if defined(__MINGW32__)
119# if defined(__clang__
)
121# if defined(__apple_build_version__)
128# if __apple_build_version__ >= 17000319
129# define Q_CC_CLANG 1915
130# elif __apple_build_version__ >= 17000013
131# define Q_CC_CLANG 1914
132# elif __apple_build_version__ >= 16000026
133# define Q_CC_CLANG 1706
134# elif __apple_build_version__ >= 15000040
135# define Q_CC_CLANG 1600
136# elif __apple_build_version__ >= 14030022
137# define Q_CC_CLANG 1500
138# elif __apple_build_version__ >= 14000029
139# define Q_CC_CLANG 1400
140# elif __apple_build_version__ >= 13160021
141# define Q_CC_CLANG 1300
142# elif __apple_build_version__ >= 13000029
143# define Q_CC_CLANG 1200
144# elif __apple_build_version__ >= 12050022
145# define Q_CC_CLANG 1110
146# elif __apple_build_version__ >= 12000032
147# define Q_CC_CLANG 1000
148# elif __apple_build_version__ >= 11030032
149# define Q_CC_CLANG 900
150# elif __apple_build_version__ >= 11000033
151# define Q_CC_CLANG 800
153# error "Unsupported Apple Clang version"
157# define Q_CC_CLANG ((__clang_major__
* 100
) + __clang_minor__
)
159# define Q_CC_CLANG_ONLY Q_CC_CLANG
161# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
163# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
165# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
168# define __has_extension __has_feature
170# if defined(__APPLE__)
172# define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
174# define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
177# ifdef __EMSCRIPTEN__
178# define Q_CC_EMSCRIPTEN
182# define Q_CC_GNU_ONLY Q_CC_GNU
184# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
185# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
186# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
191# define Q_DECL_EXPORT __declspec(dllexport)
192# define Q_DECL_IMPORT __declspec(dllimport)
194# define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
195# ifdef QT_USE_PROTECTED_VISIBILITY
196# define Q_DECL_EXPORT __attribute__((visibility("protected")))
198# define Q_DECL_EXPORT __attribute__((visibility("default")))
200# define Q_DECL_IMPORT __attribute__((visibility("default")))
201# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
204# define Q_FUNC_INFO __PRETTY_FUNCTION__
205# define Q_TYPEOF(expr) __typeof__(expr)
206# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
207# define Q_DECL_UNUSED __attribute__((__unused__))
208# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
209# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
210# define Q_NORETURN __attribute__((__noreturn__))
211# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
212# define Q_DECL_PURE_FUNCTION __attribute__((pure))
213# define Q_DECL_CONST_FUNCTION __attribute__((const))
214# define Q_DECL_COLD_FUNCTION __attribute__((cold))
215# define Q_PACKED __attribute__ ((__packed__))
217# define QT_NO_ARM_EABI
219# if Q_CC_GNU
>= 403
&& !defined(Q_CC_CLANG
)
220# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245#elif defined(__xlC__)
248# error "Compiler not supported"
249# elif __xlC__ >= 0x0600
250# define Q_TYPEOF(expr) __typeof__(expr)
251# define Q_PACKED __attribute__((__packed__))
255
256
257
258
259#elif defined(__DECCXX) || defined(__DECC)
262
267
268
269# if !defined(_BOOL_EXISTS)
270# error "Compiler not supported"
274
275# if __DECCXX_VER < 60060000
276# define Q_BROKEN_TEMPLATE_SPECIALIZATION
279# define Q_OUTOFLINE_TEMPLATE inline
282
290
291
292
293#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
296
297
298
299
300
301
302# if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
303# error "Compiler not supported"
307# if defined(__COMO__)
311
312
313
320# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
321# define Q_PACKED __attribute__ ((__packed__))
322# define Q_FUNC_INFO __PRETTY_FUNCTION__
323# define Q_TYPEOF(expr) __typeof__(expr)
324# define Q_UNREACHABLE_IMPL()
325# if defined(__cplusplus)
326# define Q_COMPILER_AUTO_TYPE
327# define Q_COMPILER_STATIC_ASSERT
328# define Q_COMPILER_RANGE_FOR
329# if __GHS_VERSION_NUMBER >= 201505
330# define Q_COMPILER_ALIGNAS
331# define Q_COMPILER_ALIGNOF
332# define Q_COMPILER_ATOMICS
333# define Q_COMPILER_ATTRIBUTES
334# define Q_COMPILER_AUTO_FUNCTION
335# define Q_COMPILER_CLASS_ENUM
336# define Q_COMPILER_DECLTYPE
337# define Q_COMPILER_DEFAULT_MEMBERS
338# define Q_COMPILER_DELETE_MEMBERS
339# define Q_COMPILER_DELEGATING_CONSTRUCTORS
340# define Q_COMPILER_EXPLICIT_CONVERSIONS
341# define Q_COMPILER_EXPLICIT_OVERRIDES
342# define Q_COMPILER_EXTERN_TEMPLATES
343# define Q_COMPILER_INHERITING_CONSTRUCTORS
344# define Q_COMPILER_INITIALIZER_LISTS
345# define Q_COMPILER_LAMBDA
346# define Q_COMPILER_NONSTATIC_MEMBER_INIT
347# define Q_COMPILER_NOEXCEPT
348# define Q_COMPILER_NULLPTR
349# define Q_COMPILER_RANGE_FOR
350# define Q_COMPILER_RAW_STRINGS
351# define Q_COMPILER_REF_QUALIFIERS
352# define Q_COMPILER_RVALUE_REFS
353# define Q_COMPILER_STATIC_ASSERT
354# define Q_COMPILER_TEMPLATE_ALIAS
355# define Q_COMPILER_THREAD_LOCAL
356# define Q_COMPILER_UDL
357# define Q_COMPILER_UNICODE_STRINGS
358# define Q_COMPILER_UNIFORM_INIT
359# define Q_COMPILER_UNRESTRICTED_UNIONS
360# define Q_COMPILER_VARIADIC_MACROS
361# define Q_COMPILER_VARIADIC_TEMPLATES
365# elif defined(__DCC__)
368# error "Compiler not supported"
372# elif defined(__USLC__) && defined(__SCO_VERSION__)
375# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010
)
376# define Q_OUTOFLINE_TEMPLATE inline
380# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
384
390
391#elif defined(_DIAB_TOOL)
393# define Q_FUNC_INFO __PRETTY_FUNCTION__
396#elif defined(__HIGHC__)
399#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
401# define Q_COMPILER_MANGLES_RETURN_TYPE
403
404
405
406# if __SUNPRO_CC >= 0x500
407# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
409# if __SUNPRO_CC >= 0x590
410# define Q_TYPEOF(expr) __typeof__(expr)
412# if __SUNPRO_CC >= 0x550
413# define Q_DECL_EXPORT __global
416# error "Compiler not supported"
420# error "Compiler not supported"
424
429# error "Compiler not supported"
431# define Q_BROKEN_TEMPLATE_SPECIALIZATION
434# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
438
439
440
441
442
444# define __has_builtin(x) 0
447# define __has_feature(x) 0
450# define __has_attribute(x) 0
452#ifndef __has_c_attribute
453# define __has_c_attribute(x) 0
456# define __has_cpp_attribute(x) 0
459# define __has_include(x) 0
462# define __has_include_next(x) 0
466
467
468
469
470
471#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
472# define QT_ASAN_ENABLED
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
530
533
534
535#define Q_COMPILER_THREADSAFE_STATICS
537#if defined(Q_CC_CLANG
)
539# define Q_COMPILER_RESTRICTED_VLA
541# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
547# define Q_COMPILER_BINARY_LITERALS
551# if Q_CC_CLANG
>= 209
552# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__
)
553 || (defined(__cplusplus
) && (__cplusplus
>= 201103L
))
554 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
))
555# define Q_COMPILER_VARIADIC_MACROS
560# if (defined(__cplusplus
) && __cplusplus
>= 201103L
)
561 || defined(__GXX_EXPERIMENTAL_CXX0X__
)
564# define Q_COMPILER_ALIGNAS
565# define Q_COMPILER_ALIGNOF
568# define Q_COMPILER_ATOMICS
571# define Q_COMPILER_ATTRIBUTES
574# define Q_COMPILER_AUTO_FUNCTION
575# define Q_COMPILER_AUTO_TYPE
578# define Q_COMPILER_CLASS_ENUM
581# define Q_COMPILER_CONSTEXPR
584# define Q_COMPILER_DECLTYPE
587# define Q_COMPILER_DEFAULT_MEMBERS
590# define Q_COMPILER_DELETE_MEMBERS
593# define Q_COMPILER_DELEGATING_CONSTRUCTORS
596# define Q_COMPILER_EXPLICIT_CONVERSIONS
599# define Q_COMPILER_EXPLICIT_OVERRIDES
602# define Q_COMPILER_INHERITING_CONSTRUCTORS
605# define Q_COMPILER_INITIALIZER_LISTS
606# define Q_COMPILER_UNIFORM_INIT
609# define Q_COMPILER_LAMBDA
612# define Q_COMPILER_NOEXCEPT
615# define Q_COMPILER_NONSTATIC_MEMBER_INIT
618# define Q_COMPILER_NULLPTR
621# define Q_COMPILER_RANGE_FOR
624# define Q_COMPILER_RAW_STRINGS
627# define Q_COMPILER_REF_QUALIFIERS
630# define Q_COMPILER_RVALUE_REFS
633# define Q_COMPILER_STATIC_ASSERT
636# define Q_COMPILER_TEMPLATE_ALIAS
639# if !defined(__FreeBSD__)
640# define Q_COMPILER_THREAD_LOCAL
644# define Q_COMPILER_UDL
647# define Q_COMPILER_UNICODE_STRINGS
650# define Q_COMPILER_UNRESTRICTED_UNIONS
653# define Q_COMPILER_VARIADIC_TEMPLATES
656# if Q_CC_CLANG
>= 209
657# define Q_COMPILER_EXTERN_TEMPLATES
662# if defined(__cplusplus
) && __cplusplus
> 201103L
667# define Q_COMPILER_GENERIC_LAMBDA
670# define Q_COMPILER_LAMBDA_CAPTURES
673# define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
676# define Q_COMPILER_RETURN_TYPE_DEDUCTION
679# define Q_COMPILER_VARIABLE_TEMPLATES
682# define Q_COMPILER_VLA
686# if defined(__STDC_VERSION__)
687# if __has_feature(c_static_assert)
688# define Q_COMPILER_STATIC_ASSERT
690# if __has_feature(c_thread_local) && __has_include(<threads.h>)
691# if !defined(__FreeBSD__)
692# define Q_COMPILER_THREAD_LOCAL
698# define Q_DECL_UNUSED __attribute__((__unused__))
703#if defined(Q_CC_GNU_ONLY)
704# define Q_COMPILER_RESTRICTED_VLA
707# define Q_COMPILER_BINARY_LITERALS
709# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
710 || (defined(__cplusplus) && (__cplusplus >= 201103L
))
711 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
))
713# define Q_COMPILER_VARIADIC_MACROS
715# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
718# define Q_COMPILER_DECLTYPE
719# define Q_COMPILER_RVALUE_REFS
720# define Q_COMPILER_STATIC_ASSERT
724# define Q_COMPILER_AUTO_FUNCTION
725# define Q_COMPILER_AUTO_TYPE
726# define Q_COMPILER_EXTERN_TEMPLATES
727# define Q_COMPILER_UNIFORM_INIT
728# define Q_COMPILER_UNICODE_STRINGS
729# define Q_COMPILER_VARIADIC_TEMPLATES
733# define Q_COMPILER_EXPLICIT_CONVERSIONS
735
736# define Q_COMPILER_INITIALIZER_LISTS
737# define Q_COMPILER_LAMBDA
738# define Q_COMPILER_RAW_STRINGS
739# define Q_COMPILER_CLASS_ENUM
743
744
745# define Q_COMPILER_DEFAULT_MEMBERS
746# define Q_COMPILER_DELETE_MEMBERS
748# define Q_COMPILER_NULLPTR
749# define Q_COMPILER_UNRESTRICTED_UNIONS
750# define Q_COMPILER_RANGE_FOR
754
755
756
757# define Q_COMPILER_ATOMICS
759
760# define Q_COMPILER_NOEXCEPT
762# define Q_COMPILER_NONSTATIC_MEMBER_INIT
763# define Q_COMPILER_DELEGATING_CONSTRUCTORS
764# define Q_COMPILER_EXPLICIT_OVERRIDES
765# define Q_COMPILER_TEMPLATE_ALIAS
766# define Q_COMPILER_UDL
769# define Q_COMPILER_ATTRIBUTES
770# define Q_COMPILER_ALIGNAS
771# define Q_COMPILER_ALIGNOF
772# define Q_COMPILER_INHERITING_CONSTRUCTORS
773# define Q_COMPILER_THREAD_LOCAL
774# if Q_CC_GNU > 408
|| __GNUC_PATCHLEVEL__ >= 1
775# define Q_COMPILER_REF_QUALIFIERS
780
781# define Q_COMPILER_CONSTEXPR
784# if __cplusplus > 201103L
788# define Q_COMPILER_LAMBDA_CAPTURES
789# define Q_COMPILER_RETURN_TYPE_DEDUCTION
792# if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
795# define Q_COMPILER_STATIC_ASSERT
797# if Q_CC_GNU >= 409
&& defined(__has_include)
799# if __has_include(<threads.h>)
800# define Q_COMPILER_THREAD_LOCAL
806#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
807# if defined(__cplusplus)
809# define Q_COMPILER_VARIADIC_MACROS
812
813
814
815
816
817
818
819
821# define Q_COMPILER_AUTO_FUNCTION
822# define Q_COMPILER_AUTO_TYPE
823# define Q_COMPILER_DECLTYPE
824# define Q_COMPILER_EXTERN_TEMPLATES
825# define Q_COMPILER_LAMBDA
826# define Q_COMPILER_NULLPTR
827# define Q_COMPILER_RVALUE_REFS
828# define Q_COMPILER_STATIC_ASSERT
830# define Q_COMPILER_EXPLICIT_OVERRIDES
831# define Q_COMPILER_CLASS_ENUM
832# define Q_COMPILER_ATOMICS
834# define Q_COMPILER_DELETE_MEMBERS
835# define Q_COMPILER_DELEGATING_CONSTRUCTORS
836# define Q_COMPILER_EXPLICIT_CONVERSIONS
837# define Q_COMPILER_NONSTATIC_MEMBER_INIT
838# define Q_COMPILER_RAW_STRINGS
839# define Q_COMPILER_TEMPLATE_ALIAS
840# define Q_COMPILER_VARIADIC_TEMPLATES
841# define Q_COMPILER_INITIALIZER_LISTS
843# define Q_COMPILER_DEFAULT_MEMBERS
844# define Q_COMPILER_ALIGNAS
845# define Q_COMPILER_ALIGNOF
846# define Q_COMPILER_INHERITING_CONSTRUCTORS
847# define Q_COMPILER_NOEXCEPT
848# define Q_COMPILER_RANGE_FOR
849# define Q_COMPILER_REF_QUALIFIERS
850# define Q_COMPILER_THREAD_LOCAL
851# define Q_COMPILER_UDL
852# define Q_COMPILER_UNICODE_STRINGS
853# define Q_COMPILER_UNRESTRICTED_UNIONS
854# if _MSC_FULL_VER >= 190023419
855# define Q_COMPILER_ATTRIBUTES
858# define Q_COMPILER_UNIFORM_INIT
861# define Q_COMPILER_CONSTEXPR
868# define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
871# define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
875#ifdef Q_COMPILER_UNICODE_STRINGS
876# define Q_STDLIB_UNICODE_STRINGS
877#elif defined(__cplusplus)
878# error "Qt6 requires Unicode string support in both the compiler and the standard library"
883# if defined(Q_OS_QNX)
892# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
898# if !defined(_HAS_CPP0X) || !_HAS_CPP0X
900# undef Q_COMPILER_INITIALIZER_LISTS
901# undef Q_COMPILER_RVALUE_REFS
902# undef Q_COMPILER_REF_QUALIFIERS
903# undef Q_COMPILER_NOEXCEPT
905# undef Q_STDLIB_UNICODE_STRINGS
907# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
908# undef Q_COMPILER_NULLPTR
910# if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
913# undef Q_COMPILER_CONSTEXPR
917# if defined(Q_CC_CLANG
) && defined(Q_OS_DARWIN)
918# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0
) * 100
+ __GNUC_LIBSTD_MINOR__-0
<= 402
)
921# undef Q_COMPILER_INITIALIZER_LISTS
922# undef Q_COMPILER_RVALUE_REFS
923# undef Q_COMPILER_REF_QUALIFIERS
925# undef Q_COMPILER_ATOMICS
927# if defined(__cpp_lib_memory_resource)
928 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000
)
929 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000
))
930# undef __cpp_lib_memory_resource
936#if defined(Q_COMPILER_DEFAULT_MEMBERS
) && defined(Q_COMPILER_DELETE_MEMBERS
)
937# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
941
942
943
944#define Q_ALIGNOF(x) alignof(x)
945#define Q_DECL_ALIGN(n) alignas(n)
948# define Q_CONSTEXPR constexpr
949# define Q_DECL_CONSTEXPR constexpr
950# define Q_DECL_EQ_DEFAULT = default
951# define Q_DECL_EQ_DELETE = delete
952# define Q_DECL_FINAL final
953# define Q_DECL_NOEXCEPT noexcept
954# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
955# define Q_DECL_OVERRIDE override
956# define Q_DECL_RELAXED_CONSTEXPR constexpr
957# define Q_NULLPTR nullptr
958# define Q_RELAXED_CONSTEXPR constexpr
960# define Q_CONSTEXPR const
961# define Q_DECL_CONSTEXPR
962# define Q_DECL_RELAXED_CONSTEXPR
963# define Q_NULLPTR NULL
964# define Q_RELAXED_CONSTEXPR const
966# define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
968# define Q_DECL_NOEXCEPT
974# undef Q_REQUIRED_RESULT
975# define Q_REQUIRED_RESULT [[nodiscard]]
981# ifndef Q_NODISCARD_CTOR
982# define Q_NODISCARD_CTOR [[nodiscard]]
985# ifndef Q_NODISCARD_X
986# define Q_NODISCARD_X(message) [[nodiscard(message)]]
988# ifndef Q_NODISCARD_CTOR_X
989# define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
996# define Q_DECL_UNUSED [[maybe_unused]]
1002# define Q_NORETURN [[noreturn]]
1005#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU
< 1300
1012# undef Q_DECL_DEPRECATED
1015# undef Q_DECL_DEPRECATED_X
1017# define Q_DECL_DEPRECATED [[deprecated]]
1018# define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
1024#ifndef Q_DECL_CONSTEXPR_DTOR
1025# if __cpp_constexpr
>= 201907L
1026# define Q_DECL_CONSTEXPR_DTOR constexpr
1028# define Q_DECL_CONSTEXPR_DTOR inline
1032#ifndef Q_CONSTEXPR_DTOR
1033# if __cpp_constexpr
>= 201907L
1034# define Q_CONSTEXPR_DTOR constexpr
1036# define Q_CONSTEXPR_DTOR const
1040#ifndef Q_DECL_EQ_DELETE_X
1044# if defined(__cpp_deleted_function
) && __cpp_deleted_function
>= 202403L
1045 && (!defined(Q_CC_CLANG_ONLY
) || Q_CC_CLANG_ONLY
>= 2010
|| __cplusplus
> 202302L
)
1046# define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
1048# define Q_DECL_EQ_DELETE_X(reason) = delete
1052#ifndef Q_LIKELY_BRANCH
1054# define Q_LIKELY_BRANCH [[likely]]
1055# define Q_UNLIKELY_BRANCH [[unlikely]]
1057# define Q_LIKELY_BRANCH
1058# define Q_UNLIKELY_BRANCH
1063
1064
1070# define Q_LIKELY(x) (x)
1073# define Q_UNLIKELY(x) (x)
1076# define Q_ASSUME_IMPL(expr) qt_noop()
1079# define Q_UNREACHABLE_IMPL() qt_noop()
1082# define Q_ALLOC_SIZE(x)
1085# define Q_REQUIRED_RESULT
1088# define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1091# define Q_NODISCARD_CTOR
1094# define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1097# define Q_DECL_DEPRECATED
1099#ifndef Q_DECL_VARIABLE_DEPRECATED
1103# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1106# define Q_DECL_EXPORT
1109# define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1112# define Q_DECL_IMPORT
1115# define Q_DECL_HIDDEN
1118# define Q_DECL_UNUSED
1121# define Q_DECL_UNUSED_MEMBER
1124# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1125# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1127# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1130#ifndef Q_DECL_CF_RETURNS_RETAINED
1131# define Q_DECL_CF_RETURNS_RETAINED
1133#ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1134# define Q_DECL_NS_RETURNS_AUTORELEASED
1137# define Q_DECL_PURE_FUNCTION
1140# define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1143# define Q_DECL_COLD_FUNCTION
1145#ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1146# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1148#ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1149# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1153
1154
1155
1157# define Q_WEAK_OVERLOAD template <typename = void>
1159# define Q_WEAK_OVERLOAD
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1181# define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1183# define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1187
1188
1190#define QT_DO_PRAGMA(text) _Pragma(#text)
1191#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
1193# define QT_WARNING_PUSH __pragma(warning(push))
1194# define QT_WARNING_POP __pragma(warning(pop))
1195# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1196# define QT_WARNING_DISABLE_INTEL(number)
1197# define QT_WARNING_DISABLE_CLANG(text)
1198# define QT_WARNING_DISABLE_GCC(text)
1199# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996
)
1200# define QT_WARNING_DISABLE_FLOAT_COMPARE
1201# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1202#elif defined(Q_CC_CLANG
)
1203# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1204# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1205# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1206# define QT_WARNING_DISABLE_GCC(text)
1207# define QT_WARNING_DISABLE_INTEL(number)
1208# define QT_WARNING_DISABLE_MSVC(number)
1212#elif defined(Q_CC_GNU) && (__GNUC__ * 100
+ __GNUC_MINOR__ >= 406
)
1213# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1214# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1215# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1216# define QT_WARNING_DISABLE_CLANG(text)
1217# define QT_WARNING_DISABLE_INTEL(number)
1218# define QT_WARNING_DISABLE_MSVC(number)
1219# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1220# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1221# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1223# define QT_WARNING_DISABLE_GCC(text)
1224# define QT_WARNING_PUSH
1225# define QT_WARNING_POP
1226# define QT_WARNING_DISABLE_INTEL(number)
1227# define QT_WARNING_DISABLE_MSVC(number)
1228# define QT_WARNING_DISABLE_CLANG(text)
1229# define QT_WARNING_DISABLE_GCC(text)
1230# define QT_WARNING_DISABLE_DEPRECATED
1231# define QT_WARNING_DISABLE_FLOAT_COMPARE
1232# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1235#ifndef QT_IGNORE_DEPRECATIONS
1236#define QT_IGNORE_DEPRECATIONS(statement)
1250#define Q_OFFSETOF(Class, member)
1253 return offsetof(Class, member);
1258
1259
1260#ifndef QT_NO_KEYWORDS
1261# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1262# define for if (0
) {} else for
1266#ifdef Q_COMPILER_RVALUE_REFS
1267#define qMove(x) std::move(x)
1272#if defined(__cplusplus
)
1274# define Q_FALLTHROUGH() [[clang::fallthrough]]
1275#elif __has_cpp_attribute(gnu::fallthrough)
1276# define Q_FALLTHROUGH() [[gnu::fallthrough]]
1277#elif __has_cpp_attribute(fallthrough)
1278# define Q_FALLTHROUGH() [[fallthrough]]
1281# if __has_c_attribute(fallthrough)
1282# define Q_FALLTHROUGH() [[fallthrough]]
1287# define Q_FALLTHROUGH() __attribute__((fallthrough))
1289# define Q_FALLTHROUGH() (void)0
1294# define Q_DECL_UNINITIALIZED __attribute__((uninitialized))
1296# define Q_DECL_UNINITIALIZED
1301
1302
1303#if !defined(Q_PROCESSOR_X86)
1304# undef QT_COMPILER_SUPPORTS_SSE2
1305# undef QT_COMPILER_SUPPORTS_SSE3
1306# undef QT_COMPILER_SUPPORTS_SSSE3
1307# undef QT_COMPILER_SUPPORTS_SSE4_1
1308# undef QT_COMPILER_SUPPORTS_SSE4_2
1309# undef QT_COMPILER_SUPPORTS_AVX
1310# undef QT_COMPILER_SUPPORTS_AVX2
1311# undef QT_COMPILER_SUPPORTS_F16C
1313#if !defined(Q_PROCESSOR_ARM)
1314# undef QT_COMPILER_SUPPORTS_NEON
1316#if !defined(Q_PROCESSOR_MIPS)
1317# undef QT_COMPILER_SUPPORTS_MIPS_DSP
1318# undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1322#if defined(__cplusplus
) && (__cplusplus
< 201703L
)
1324# 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."
1326# error "Qt requires a C++17 compiler"
1330#if defined(__cplusplus
) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
1331# if Q_CC_MSVC < 1930
1332# error "Qt requires at least Visual Studio 2022 (MSVC version 19.30 or newer). 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]