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__ >= 17000013
128# define Q_CC_CLANG 1914
129# elif __apple_build_version__ >= 16000026
130# define Q_CC_CLANG 1706
131# elif __apple_build_version__ >= 15000040
132# define Q_CC_CLANG 1600
133# elif __apple_build_version__ >= 14030022
134# define Q_CC_CLANG 1500
135# elif __apple_build_version__ >= 14000029
136# define Q_CC_CLANG 1400
137# elif __apple_build_version__ >= 13160021
138# define Q_CC_CLANG 1300
139# elif __apple_build_version__ >= 13000029
140# define Q_CC_CLANG 1200
141# elif __apple_build_version__ >= 12050022
142# define Q_CC_CLANG 1110
143# elif __apple_build_version__ >= 12000032
144# define Q_CC_CLANG 1000
145# elif __apple_build_version__ >= 11030032
146# define Q_CC_CLANG 900
147# elif __apple_build_version__ >= 11000033
148# define Q_CC_CLANG 800
150# error "Unsupported Apple Clang version"
154# define Q_CC_CLANG ((__clang_major__
* 100
) + __clang_minor__
)
156# define Q_CC_CLANG_ONLY Q_CC_CLANG
158# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
160# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
162# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
165# define __has_extension __has_feature
167# if defined(__APPLE__)
169# define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
171# define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
174# ifdef __EMSCRIPTEN__
175# define Q_CC_EMSCRIPTEN
179# define Q_CC_GNU_ONLY Q_CC_GNU
181# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
182# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
183# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
188# define Q_DECL_EXPORT __declspec(dllexport)
189# define Q_DECL_IMPORT __declspec(dllimport)
191# define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
192# ifdef QT_USE_PROTECTED_VISIBILITY
193# define Q_DECL_EXPORT __attribute__((visibility("protected")))
195# define Q_DECL_EXPORT __attribute__((visibility("default")))
197# define Q_DECL_IMPORT __attribute__((visibility("default")))
198# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
201# define Q_FUNC_INFO __PRETTY_FUNCTION__
202# define Q_TYPEOF(expr) __typeof__(expr)
203# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
204# define Q_DECL_UNUSED __attribute__((__unused__))
205# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
206# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
207# define Q_NORETURN __attribute__((__noreturn__))
208# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
209# define Q_DECL_PURE_FUNCTION __attribute__((pure))
210# define Q_DECL_CONST_FUNCTION __attribute__((const))
211# define Q_DECL_COLD_FUNCTION __attribute__((cold))
212# define Q_PACKED __attribute__ ((__packed__))
214# define QT_NO_ARM_EABI
216# if Q_CC_GNU
>= 403
&& !defined(Q_CC_CLANG
)
217# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242#elif defined(__xlC__)
245# error "Compiler not supported"
246# elif __xlC__ >= 0x0600
247# define Q_TYPEOF(expr) __typeof__(expr)
248# define Q_PACKED __attribute__((__packed__))
252
253
254
255
256#elif defined(__DECCXX) || defined(__DECC)
259
264
265
266# if !defined(_BOOL_EXISTS)
267# error "Compiler not supported"
271
272# if __DECCXX_VER < 60060000
273# define Q_BROKEN_TEMPLATE_SPECIALIZATION
276# define Q_OUTOFLINE_TEMPLATE inline
279
287
288
289
290#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
293
294
295
296
297
298
299# if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
300# error "Compiler not supported"
304# if defined(__COMO__)
308
309
310
317# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
318# define Q_PACKED __attribute__ ((__packed__))
319# define Q_FUNC_INFO __PRETTY_FUNCTION__
320# define Q_TYPEOF(expr) __typeof__(expr)
321# define Q_UNREACHABLE_IMPL()
322# if defined(__cplusplus)
323# define Q_COMPILER_AUTO_TYPE
324# define Q_COMPILER_STATIC_ASSERT
325# define Q_COMPILER_RANGE_FOR
326# if __GHS_VERSION_NUMBER >= 201505
327# define Q_COMPILER_ALIGNAS
328# define Q_COMPILER_ALIGNOF
329# define Q_COMPILER_ATOMICS
330# define Q_COMPILER_ATTRIBUTES
331# define Q_COMPILER_AUTO_FUNCTION
332# define Q_COMPILER_CLASS_ENUM
333# define Q_COMPILER_DECLTYPE
334# define Q_COMPILER_DEFAULT_MEMBERS
335# define Q_COMPILER_DELETE_MEMBERS
336# define Q_COMPILER_DELEGATING_CONSTRUCTORS
337# define Q_COMPILER_EXPLICIT_CONVERSIONS
338# define Q_COMPILER_EXPLICIT_OVERRIDES
339# define Q_COMPILER_EXTERN_TEMPLATES
340# define Q_COMPILER_INHERITING_CONSTRUCTORS
341# define Q_COMPILER_INITIALIZER_LISTS
342# define Q_COMPILER_LAMBDA
343# define Q_COMPILER_NONSTATIC_MEMBER_INIT
344# define Q_COMPILER_NOEXCEPT
345# define Q_COMPILER_NULLPTR
346# define Q_COMPILER_RANGE_FOR
347# define Q_COMPILER_RAW_STRINGS
348# define Q_COMPILER_REF_QUALIFIERS
349# define Q_COMPILER_RVALUE_REFS
350# define Q_COMPILER_STATIC_ASSERT
351# define Q_COMPILER_TEMPLATE_ALIAS
352# define Q_COMPILER_THREAD_LOCAL
353# define Q_COMPILER_UDL
354# define Q_COMPILER_UNICODE_STRINGS
355# define Q_COMPILER_UNIFORM_INIT
356# define Q_COMPILER_UNRESTRICTED_UNIONS
357# define Q_COMPILER_VARIADIC_MACROS
358# define Q_COMPILER_VARIADIC_TEMPLATES
362# elif defined(__DCC__)
365# error "Compiler not supported"
369# elif defined(__USLC__) && defined(__SCO_VERSION__)
372# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010
)
373# define Q_OUTOFLINE_TEMPLATE inline
377# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
381
387
388#elif defined(_DIAB_TOOL)
390# define Q_FUNC_INFO __PRETTY_FUNCTION__
393#elif defined(__HIGHC__)
396#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
398# define Q_COMPILER_MANGLES_RETURN_TYPE
400
401
402
403# if __SUNPRO_CC >= 0x500
404# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
406# if __SUNPRO_CC >= 0x590
407# define Q_TYPEOF(expr) __typeof__(expr)
409# if __SUNPRO_CC >= 0x550
410# define Q_DECL_EXPORT __global
413# error "Compiler not supported"
417# error "Compiler not supported"
421
426# error "Compiler not supported"
428# define Q_BROKEN_TEMPLATE_SPECIALIZATION
431# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
435
436
437
438
439
441# define __has_builtin(x) 0
444# define __has_feature(x) 0
447# define __has_attribute(x) 0
449#ifndef __has_c_attribute
450# define __has_c_attribute(x) 0
453# define __has_cpp_attribute(x) 0
456# define __has_include(x) 0
459# define __has_include_next(x) 0
463
464
465
466
467
468#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
469# define QT_ASAN_ENABLED
473
474
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
530
531
532#define Q_COMPILER_THREADSAFE_STATICS
534#if defined(Q_CC_CLANG
)
536# define Q_COMPILER_RESTRICTED_VLA
538# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
544# define Q_COMPILER_BINARY_LITERALS
548# if Q_CC_CLANG
>= 209
549# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__
)
550 || (defined(__cplusplus
) && (__cplusplus
>= 201103L
))
551 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
))
552# define Q_COMPILER_VARIADIC_MACROS
557# if (defined(__cplusplus
) && __cplusplus
>= 201103L
)
558 || defined(__GXX_EXPERIMENTAL_CXX0X__
)
561# define Q_COMPILER_ALIGNAS
562# define Q_COMPILER_ALIGNOF
565# define Q_COMPILER_ATOMICS
568# define Q_COMPILER_ATTRIBUTES
571# define Q_COMPILER_AUTO_FUNCTION
572# define Q_COMPILER_AUTO_TYPE
575# define Q_COMPILER_CLASS_ENUM
578# define Q_COMPILER_CONSTEXPR
581# define Q_COMPILER_DECLTYPE
584# define Q_COMPILER_DEFAULT_MEMBERS
587# define Q_COMPILER_DELETE_MEMBERS
590# define Q_COMPILER_DELEGATING_CONSTRUCTORS
593# define Q_COMPILER_EXPLICIT_CONVERSIONS
596# define Q_COMPILER_EXPLICIT_OVERRIDES
599# define Q_COMPILER_INHERITING_CONSTRUCTORS
602# define Q_COMPILER_INITIALIZER_LISTS
603# define Q_COMPILER_UNIFORM_INIT
606# define Q_COMPILER_LAMBDA
609# define Q_COMPILER_NOEXCEPT
612# define Q_COMPILER_NONSTATIC_MEMBER_INIT
615# define Q_COMPILER_NULLPTR
618# define Q_COMPILER_RANGE_FOR
621# define Q_COMPILER_RAW_STRINGS
624# define Q_COMPILER_REF_QUALIFIERS
627# define Q_COMPILER_RVALUE_REFS
630# define Q_COMPILER_STATIC_ASSERT
633# define Q_COMPILER_TEMPLATE_ALIAS
636# if !defined(__FreeBSD__)
637# define Q_COMPILER_THREAD_LOCAL
641# define Q_COMPILER_UDL
644# define Q_COMPILER_UNICODE_STRINGS
647# define Q_COMPILER_UNRESTRICTED_UNIONS
650# define Q_COMPILER_VARIADIC_TEMPLATES
653# if Q_CC_CLANG
>= 209
654# define Q_COMPILER_EXTERN_TEMPLATES
659# if defined(__cplusplus
) && __cplusplus
> 201103L
664# define Q_COMPILER_GENERIC_LAMBDA
667# define Q_COMPILER_LAMBDA_CAPTURES
670# define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
673# define Q_COMPILER_RETURN_TYPE_DEDUCTION
676# define Q_COMPILER_VARIABLE_TEMPLATES
679# define Q_COMPILER_VLA
683# if defined(__STDC_VERSION__)
684# if __has_feature(c_static_assert)
685# define Q_COMPILER_STATIC_ASSERT
687# if __has_feature(c_thread_local) && __has_include(<threads.h>)
688# if !defined(__FreeBSD__)
689# define Q_COMPILER_THREAD_LOCAL
695# define Q_DECL_UNUSED __attribute__((__unused__))
700#if defined(Q_CC_GNU_ONLY)
701# define Q_COMPILER_RESTRICTED_VLA
704# define Q_COMPILER_BINARY_LITERALS
706# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
707 || (defined(__cplusplus) && (__cplusplus >= 201103L
))
708 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L
))
710# define Q_COMPILER_VARIADIC_MACROS
712# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
715# define Q_COMPILER_DECLTYPE
716# define Q_COMPILER_RVALUE_REFS
717# define Q_COMPILER_STATIC_ASSERT
721# define Q_COMPILER_AUTO_FUNCTION
722# define Q_COMPILER_AUTO_TYPE
723# define Q_COMPILER_EXTERN_TEMPLATES
724# define Q_COMPILER_UNIFORM_INIT
725# define Q_COMPILER_UNICODE_STRINGS
726# define Q_COMPILER_VARIADIC_TEMPLATES
730# define Q_COMPILER_EXPLICIT_CONVERSIONS
732
733# define Q_COMPILER_INITIALIZER_LISTS
734# define Q_COMPILER_LAMBDA
735# define Q_COMPILER_RAW_STRINGS
736# define Q_COMPILER_CLASS_ENUM
740
741
742# define Q_COMPILER_DEFAULT_MEMBERS
743# define Q_COMPILER_DELETE_MEMBERS
745# define Q_COMPILER_NULLPTR
746# define Q_COMPILER_UNRESTRICTED_UNIONS
747# define Q_COMPILER_RANGE_FOR
751
752
753
754# define Q_COMPILER_ATOMICS
756
757# define Q_COMPILER_NOEXCEPT
759# define Q_COMPILER_NONSTATIC_MEMBER_INIT
760# define Q_COMPILER_DELEGATING_CONSTRUCTORS
761# define Q_COMPILER_EXPLICIT_OVERRIDES
762# define Q_COMPILER_TEMPLATE_ALIAS
763# define Q_COMPILER_UDL
766# define Q_COMPILER_ATTRIBUTES
767# define Q_COMPILER_ALIGNAS
768# define Q_COMPILER_ALIGNOF
769# define Q_COMPILER_INHERITING_CONSTRUCTORS
770# define Q_COMPILER_THREAD_LOCAL
771# if Q_CC_GNU > 408
|| __GNUC_PATCHLEVEL__ >= 1
772# define Q_COMPILER_REF_QUALIFIERS
777
778# define Q_COMPILER_CONSTEXPR
781# if __cplusplus > 201103L
785# define Q_COMPILER_LAMBDA_CAPTURES
786# define Q_COMPILER_RETURN_TYPE_DEDUCTION
789# if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
792# define Q_COMPILER_STATIC_ASSERT
794# if Q_CC_GNU >= 409
&& defined(__has_include)
796# if __has_include(<threads.h>)
797# define Q_COMPILER_THREAD_LOCAL
803#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
804# if defined(__cplusplus)
806# define Q_COMPILER_VARIADIC_MACROS
809
810
811
812
813
814
815
816
818# define Q_COMPILER_AUTO_FUNCTION
819# define Q_COMPILER_AUTO_TYPE
820# define Q_COMPILER_DECLTYPE
821# define Q_COMPILER_EXTERN_TEMPLATES
822# define Q_COMPILER_LAMBDA
823# define Q_COMPILER_NULLPTR
824# define Q_COMPILER_RVALUE_REFS
825# define Q_COMPILER_STATIC_ASSERT
827# define Q_COMPILER_EXPLICIT_OVERRIDES
828# define Q_COMPILER_CLASS_ENUM
829# define Q_COMPILER_ATOMICS
831# define Q_COMPILER_DELETE_MEMBERS
832# define Q_COMPILER_DELEGATING_CONSTRUCTORS
833# define Q_COMPILER_EXPLICIT_CONVERSIONS
834# define Q_COMPILER_NONSTATIC_MEMBER_INIT
835# define Q_COMPILER_RAW_STRINGS
836# define Q_COMPILER_TEMPLATE_ALIAS
837# define Q_COMPILER_VARIADIC_TEMPLATES
838# define Q_COMPILER_INITIALIZER_LISTS
840# define Q_COMPILER_DEFAULT_MEMBERS
841# define Q_COMPILER_ALIGNAS
842# define Q_COMPILER_ALIGNOF
843# define Q_COMPILER_INHERITING_CONSTRUCTORS
844# define Q_COMPILER_NOEXCEPT
845# define Q_COMPILER_RANGE_FOR
846# define Q_COMPILER_REF_QUALIFIERS
847# define Q_COMPILER_THREAD_LOCAL
848# define Q_COMPILER_UDL
849# define Q_COMPILER_UNICODE_STRINGS
850# define Q_COMPILER_UNRESTRICTED_UNIONS
851# if _MSC_FULL_VER >= 190023419
852# define Q_COMPILER_ATTRIBUTES
855# define Q_COMPILER_UNIFORM_INIT
858# define Q_COMPILER_CONSTEXPR
865# define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
868# define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
872#ifdef Q_COMPILER_UNICODE_STRINGS
873# define Q_STDLIB_UNICODE_STRINGS
874#elif defined(__cplusplus)
875# error "Qt6 requires Unicode string support in both the compiler and the standard library"
880# if defined(Q_OS_QNX)
889# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
895# if !defined(_HAS_CPP0X) || !_HAS_CPP0X
897# undef Q_COMPILER_INITIALIZER_LISTS
898# undef Q_COMPILER_RVALUE_REFS
899# undef Q_COMPILER_REF_QUALIFIERS
900# undef Q_COMPILER_NOEXCEPT
902# undef Q_STDLIB_UNICODE_STRINGS
904# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
905# undef Q_COMPILER_NULLPTR
907# if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
910# undef Q_COMPILER_CONSTEXPR
914# if defined(Q_CC_CLANG
) && defined(Q_OS_DARWIN)
915# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0
) * 100
+ __GNUC_LIBSTD_MINOR__-0
<= 402
)
918# undef Q_COMPILER_INITIALIZER_LISTS
919# undef Q_COMPILER_RVALUE_REFS
920# undef Q_COMPILER_REF_QUALIFIERS
922# undef Q_COMPILER_ATOMICS
924# if defined(__cpp_lib_memory_resource)
925 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000
)
926 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000
))
927# undef __cpp_lib_memory_resource
933#if defined(Q_COMPILER_DEFAULT_MEMBERS
) && defined(Q_COMPILER_DELETE_MEMBERS
)
934# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
938
939
940
941#define Q_ALIGNOF(x) alignof(x)
942#define Q_DECL_ALIGN(n) alignas(n)
945# define Q_CONSTEXPR constexpr
946# define Q_DECL_CONSTEXPR constexpr
947# define Q_DECL_EQ_DEFAULT = default
948# define Q_DECL_EQ_DELETE = delete
949# define Q_DECL_FINAL final
950# define Q_DECL_NOEXCEPT noexcept
951# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
952# define Q_DECL_OVERRIDE override
953# define Q_DECL_RELAXED_CONSTEXPR constexpr
954# define Q_NULLPTR nullptr
955# define Q_RELAXED_CONSTEXPR constexpr
957# define Q_CONSTEXPR const
958# define Q_DECL_CONSTEXPR
959# define Q_DECL_RELAXED_CONSTEXPR
960# define Q_NULLPTR NULL
961# define Q_RELAXED_CONSTEXPR const
963# define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
965# define Q_DECL_NOEXCEPT
971# undef Q_REQUIRED_RESULT
972# define Q_REQUIRED_RESULT [[nodiscard]]
978# ifndef Q_NODISCARD_CTOR
979# define Q_NODISCARD_CTOR [[nodiscard]]
982# ifndef Q_NODISCARD_X
983# define Q_NODISCARD_X(message) [[nodiscard(message)]]
985# ifndef Q_NODISCARD_CTOR_X
986# define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
993# define Q_DECL_UNUSED [[maybe_unused]]
999# define Q_NORETURN [[noreturn]]
1005# undef Q_DECL_DEPRECATED
1008# undef Q_DECL_DEPRECATED_X
1010# define Q_DECL_DEPRECATED [[deprecated]]
1011# define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
1017#ifndef Q_DECL_CONSTEXPR_DTOR
1018# if __cpp_constexpr
>= 201907L
1019# define Q_DECL_CONSTEXPR_DTOR constexpr
1021# define Q_DECL_CONSTEXPR_DTOR inline
1025#ifndef Q_CONSTEXPR_DTOR
1026# if __cpp_constexpr
>= 201907L
1027# define Q_CONSTEXPR_DTOR constexpr
1029# define Q_CONSTEXPR_DTOR const
1033#ifndef Q_DECL_EQ_DELETE_X
1037# if defined(__cpp_deleted_function
) && __cpp_deleted_function
>= 202403L
1038 && (!defined(Q_CC_CLANG_ONLY
) || Q_CC_CLANG_ONLY
>= 2010
|| __cplusplus
> 202302L
)
1039# define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
1041# define Q_DECL_EQ_DELETE_X(reason) = delete
1045#ifndef Q_LIKELY_BRANCH
1047# define Q_LIKELY_BRANCH [[likely]]
1048# define Q_UNLIKELY_BRANCH [[unlikely]]
1050# define Q_LIKELY_BRANCH
1051# define Q_UNLIKELY_BRANCH
1056
1057
1063# define Q_LIKELY(x) (x)
1066# define Q_UNLIKELY(x) (x)
1069# define Q_ASSUME_IMPL(expr) qt_noop()
1072# define Q_UNREACHABLE_IMPL() qt_noop()
1075# define Q_ALLOC_SIZE(x)
1078# define Q_REQUIRED_RESULT
1081# define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1084# define Q_NODISCARD_CTOR
1087# define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1090# define Q_DECL_DEPRECATED
1092#ifndef Q_DECL_VARIABLE_DEPRECATED
1096# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1099# define Q_DECL_EXPORT
1102# define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1105# define Q_DECL_IMPORT
1108# define Q_DECL_HIDDEN
1111# define Q_DECL_UNUSED
1114# define Q_DECL_UNUSED_MEMBER
1117# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1118# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1120# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1123#ifndef Q_DECL_CF_RETURNS_RETAINED
1124# define Q_DECL_CF_RETURNS_RETAINED
1126#ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1127# define Q_DECL_NS_RETURNS_AUTORELEASED
1130# define Q_DECL_PURE_FUNCTION
1133# define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1136# define Q_DECL_COLD_FUNCTION
1138#ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1139# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1141#ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1142# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1146
1147
1148
1150# define Q_WEAK_OVERLOAD template <typename = void>
1152# define Q_WEAK_OVERLOAD
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1174# define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1176# define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1180
1181
1183#define QT_DO_PRAGMA(text) _Pragma(#text)
1184#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
1186# define QT_WARNING_PUSH __pragma(warning(push))
1187# define QT_WARNING_POP __pragma(warning(pop))
1188# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1189# define QT_WARNING_DISABLE_INTEL(number)
1190# define QT_WARNING_DISABLE_CLANG(text)
1191# define QT_WARNING_DISABLE_GCC(text)
1192# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996
)
1193# define QT_WARNING_DISABLE_FLOAT_COMPARE
1194# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1195#elif defined(Q_CC_CLANG
)
1196# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1197# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1198# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1199# define QT_WARNING_DISABLE_GCC(text)
1200# define QT_WARNING_DISABLE_INTEL(number)
1201# define QT_WARNING_DISABLE_MSVC(number)
1205#elif defined(Q_CC_GNU) && (__GNUC__ * 100
+ __GNUC_MINOR__ >= 406
)
1206# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1207# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1208# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1209# define QT_WARNING_DISABLE_CLANG(text)
1210# define QT_WARNING_DISABLE_INTEL(number)
1211# define QT_WARNING_DISABLE_MSVC(number)
1212# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1213# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1214# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1216# define QT_WARNING_DISABLE_GCC(text)
1217# define QT_WARNING_PUSH
1218# define QT_WARNING_POP
1219# define QT_WARNING_DISABLE_INTEL(number)
1220# define QT_WARNING_DISABLE_MSVC(number)
1221# define QT_WARNING_DISABLE_CLANG(text)
1222# define QT_WARNING_DISABLE_GCC(text)
1223# define QT_WARNING_DISABLE_DEPRECATED
1224# define QT_WARNING_DISABLE_FLOAT_COMPARE
1225# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1228#ifndef QT_IGNORE_DEPRECATIONS
1229#define QT_IGNORE_DEPRECATIONS(statement)
1243#define Q_OFFSETOF(Class, member)
1246 return offsetof(Class, member);
1251
1252
1253#ifndef QT_NO_KEYWORDS
1254# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1255# define for if (0
) {} else for
1259#ifdef Q_COMPILER_RVALUE_REFS
1260#define qMove(x) std::move(x)
1265#if defined(__cplusplus
)
1267# define Q_FALLTHROUGH() [[clang::fallthrough]]
1268#elif __has_cpp_attribute(gnu::fallthrough)
1269# define Q_FALLTHROUGH() [[gnu::fallthrough]]
1270#elif __has_cpp_attribute(fallthrough)
1271# define Q_FALLTHROUGH() [[fallthrough]]
1274# if __has_c_attribute(fallthrough)
1275# define Q_FALLTHROUGH() [[fallthrough]]
1280# define Q_FALLTHROUGH() __attribute__((fallthrough))
1282# define Q_FALLTHROUGH() (void)0
1287# define Q_DECL_UNINITIALIZED __attribute__((uninitialized))
1289# define Q_DECL_UNINITIALIZED
1294
1295
1296#if !defined(Q_PROCESSOR_X86)
1297# undef QT_COMPILER_SUPPORTS_SSE2
1298# undef QT_COMPILER_SUPPORTS_SSE3
1299# undef QT_COMPILER_SUPPORTS_SSSE3
1300# undef QT_COMPILER_SUPPORTS_SSE4_1
1301# undef QT_COMPILER_SUPPORTS_SSE4_2
1302# undef QT_COMPILER_SUPPORTS_AVX
1303# undef QT_COMPILER_SUPPORTS_AVX2
1304# undef QT_COMPILER_SUPPORTS_F16C
1306#if !defined(Q_PROCESSOR_ARM)
1307# undef QT_COMPILER_SUPPORTS_NEON
1309#if !defined(Q_PROCESSOR_MIPS)
1310# undef QT_COMPILER_SUPPORTS_MIPS_DSP
1311# undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1315#if defined(__cplusplus
) && (__cplusplus
< 201703L
)
1317# 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."
1319# error "Qt requires a C++17 compiler"
1323#if defined(__cplusplus
) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG
)
1324# if Q_CC_MSVC < 1927
1326# error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1333static_assert(!std::is_convertible_v<std::nullptr_t,
bool>,
1334 "On MSVC you must pass the /permissive- option to the compiler.");
1337#if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__
) || defined(__PIC__
)
1339#elif defined(__PIE__)
1340# error "-fPIE is not sufficient if Qt was configured with the -DFEATURE_reduce_relocations=ON "
1341 "CMake option. Compile your code with -fPIC and without -fPIE or compile Qt with "
1342 "-DFEATURE_no_direct_extern_access=ON."
1343#elif defined(QT_REDUCE_RELOCATIONS)
1344# error "You must build your code with position independent code if Qt was configured with the "
1345 "-DFEATURE_reduce_relocations=ON CMake option. Compile your code with -fPIC and "
1346 "without -fPIE or compile Qt with -DFEATURE_no_direct_extern_access=ON."
1349#ifdef Q_PROCESSOR_X86_32
1350# if defined(Q_CC_GNU)
1351# define QT_FASTCALL __attribute__((regparm(3
)))
1352# elif defined(Q_CC_MSVC)
1353# define QT_FASTCALL __fastcall
1362#if defined(Q_CC_GNU
) && !defined(__INSURE__)
1363# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG
)
1364# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1365 __attribute__((format(gnu_printf, (A), (B))))
1367# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1368 __attribute__((format(printf, (A), (B))))
1371# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1375# define Q_NEVER_INLINE __declspec(noinline)
1376# define Q_ALWAYS_INLINE __forceinline
1377#elif defined(Q_CC_GNU
)
1378# define Q_NEVER_INLINE __attribute__((noinline))
1379# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
1381# define Q_NEVER_INLINE
1382# define Q_ALWAYS_INLINE inline
1387#if defined(Q_OS_WIN)
1388# if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
1389# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1391# define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1393# define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1396#ifdef __cpp_conditional_explicit
1397#define Q_IMPLICIT explicit(false)
1402#if defined(__cplusplus
)
1404#ifdef __cpp_constinit
1405# if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1409# define Q_CONSTINIT constinit
1412# define Q_CONSTINIT [[clang::require_constant_initialization]]
1413#elif defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1000
1414# define Q_CONSTINIT __constinit
1419#ifndef Q_OUTOFLINE_TEMPLATE
1420# define Q_OUTOFLINE_TEMPLATE
1422#ifndef Q_INLINE_TEMPLATE
1423# define Q_INLINE_TEMPLATE inline
1427
1428
1429
1430
1431#if !defined(QT_CC_WARNINGS)
1432# define QT_NO_WARNINGS
1434#if defined(QT_NO_WARNINGS
)
1435# if defined(Q_CC_MSVC)
1436QT_WARNING_DISABLE_MSVC(4251)
1437QT_WARNING_DISABLE_MSVC(4244)
1438QT_WARNING_DISABLE_MSVC(4275)
1439QT_WARNING_DISABLE_MSVC(4514)
1440QT_WARNING_DISABLE_MSVC(4800)
1441QT_WARNING_DISABLE_MSVC(4097)
1442QT_WARNING_DISABLE_MSVC(4706)
1443QT_WARNING_DISABLE_MSVC(4355)
1444QT_WARNING_DISABLE_MSVC(4710)
1445QT_WARNING_DISABLE_MSVC(4530)
1446# elif defined(Q_CC_BOR)
1447# pragma option -w-inl
1448# pragma option -w-aus
1457#if !defined(QT_NO_EXCEPTIONS)
1458# if !defined(Q_MOC_RUN)
1459# if defined(Q_CC_GNU
) && !defined(__cpp_exceptions
)
1460# define QT_NO_EXCEPTIONS
1462# elif defined(QT_BOOTSTRAPPED)
1463# define QT_NO_EXCEPTIONS
1468#if __cplusplus
>= 202002L
&& (!defined(_GLIBCXX_RELEASE
) || _GLIBCXX_RELEASE
>= 11
)
1469# define QT_COMPILER_HAS_LWG3346
1472#if defined(__cplusplus
) && __cplusplus
>= 202002L
1473# if !defined(Q_CC_MSVC_ONLY) || Q_CC_MSVC >= 1939
1476# define QT_COMPILER_HAS_P0846
1480#ifdef QT_COMPILER_HAS_P0846
1481# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1483 class QT_CLASS_JUST_FOR_P0846_SIMULATION;
1484# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1485 template <typename T>
1486 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]