5#include <QtCore/qsystemdetection.h>
8#pragma qt_class(QtCompilerDetection)
9#pragma qt_sync_skip_header_check
10#pragma qt_sync_stop_processing
13#ifndef QCOMPILERDETECTION_H
14#define QCOMPILERDETECTION_H
16#include <QtCore/qprocessordetection.h>
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)
78# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) stdext::make_unchecked_array_iterator(x)
79# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N))
81#elif defined(__BORLANDC__) || defined(__TURBOC__)
83# define Q_INLINE_TEMPLATE
84# if __BORLANDC__ < 0x502
85# error "Compiler not supported"
88#elif defined(__WATCOMC__)
94#elif defined(__ARMCC__) || defined(__CC_ARM)
97# define __is_empty(X) false
98# define __is_pod(X) false
99# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
101# define Q_DECL_EXPORT __attribute__((visibility("default")))
102# define Q_DECL_IMPORT __attribute__((visibility("default")))
103# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
105# define Q_DECL_EXPORT __declspec(dllexport)
106# define Q_DECL_IMPORT __declspec(dllimport)
109#elif defined(__GNUC__)
110# define Q_CC_GNU (__GNUC__ * 100 + __GNUC_MINOR__)
111# if defined(__MINGW32__)
114# if defined(__clang__)
116# if defined(__apple_build_version__)
123# if __apple_build_version__ >= 14030022
124# define Q_CC_CLANG 1500
125# elif __apple_build_version__ >= 14000029
126# define Q_CC_CLANG 1400
127# elif __apple_build_version__ >= 13160021
128# define Q_CC_CLANG 1300
129# elif __apple_build_version__ >= 13000029
130# define Q_CC_CLANG 1200
131# elif __apple_build_version__ >= 12050022
132# define Q_CC_CLANG 1110
133# elif __apple_build_version__ >= 12000032
134# define Q_CC_CLANG 1000
135# elif __apple_build_version__ >= 11030032
136# define Q_CC_CLANG 900
137# elif __apple_build_version__ >= 11000033
138# define Q_CC_CLANG 800
140# error "Unsupported Apple Clang version"
144# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
146# define Q_CC_CLANG_ONLY Q_CC_CLANG
147# if __has_builtin(__builtin_assume)
148# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
150# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
152# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
153# if !defined(__has_extension)
155# define __has_extension __has_feature
157# if defined(__APPLE__)
159# define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
161# define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
164# ifdef __EMSCRIPTEN__
165# define Q_CC_EMSCRIPTEN
169# define Q_CC_GNU_ONLY Q_CC_GNU
171# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
172# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
173# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
178# define Q_DECL_EXPORT __declspec(dllexport)
179# define Q_DECL_IMPORT __declspec(dllimport)
181# define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
182# ifdef QT_USE_PROTECTED_VISIBILITY
183# define Q_DECL_EXPORT __attribute__((visibility("protected")))
185# define Q_DECL_EXPORT __attribute__((visibility("default")))
187# define Q_DECL_IMPORT __attribute__((visibility("default")))
188# define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
191# define Q_FUNC_INFO __PRETTY_FUNCTION__
192# define Q_TYPEOF(expr) __typeof__(expr)
193# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
194# define Q_DECL_UNUSED __attribute__((__unused__))
195# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
196# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
197# define Q_NORETURN __attribute__((__noreturn__))
198# define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
199# define Q_DECL_PURE_FUNCTION __attribute__((pure))
200# define Q_DECL_CONST_FUNCTION __attribute__((const))
201# define Q_DECL_COLD_FUNCTION __attribute__((cold))
202# if !defined(QT_MOC_CPP)
203# define Q_PACKED __attribute__ ((__packed__))
205# define QT_NO_ARM_EABI
208# if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG)
209# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
234#elif defined(__xlC__)
237# error "Compiler not supported"
238# elif __xlC__ >= 0x0600
239# define Q_TYPEOF(expr) __typeof__(expr)
240# define Q_PACKED __attribute__((__packed__))
248#elif defined(__DECCXX) || defined(__DECC)
258# if !defined(_BOOL_EXISTS)
259# error "Compiler not supported"
264# if __DECCXX_VER < 60060000
265# define Q_BROKEN_TEMPLATE_SPECIALIZATION
268# define Q_OUTOFLINE_TEMPLATE inline
282#elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
291# if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
292# error "Compiler not supported"
296# if defined(__COMO__)
309# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
310# define Q_PACKED __attribute__ ((__packed__))
311# define Q_FUNC_INFO __PRETTY_FUNCTION__
312# define Q_TYPEOF(expr) __typeof__(expr)
313# define Q_UNREACHABLE_IMPL()
314# if defined(__cplusplus)
315# define Q_COMPILER_AUTO_TYPE
316# define Q_COMPILER_STATIC_ASSERT
317# define Q_COMPILER_RANGE_FOR
318# if __GHS_VERSION_NUMBER >= 201505
319# define Q_COMPILER_ALIGNAS
320# define Q_COMPILER_ALIGNOF
321# define Q_COMPILER_ATOMICS
322# define Q_COMPILER_ATTRIBUTES
323# define Q_COMPILER_AUTO_FUNCTION
324# define Q_COMPILER_CLASS_ENUM
325# define Q_COMPILER_DECLTYPE
326# define Q_COMPILER_DEFAULT_MEMBERS
327# define Q_COMPILER_DELETE_MEMBERS
328# define Q_COMPILER_DELEGATING_CONSTRUCTORS
329# define Q_COMPILER_EXPLICIT_CONVERSIONS
330# define Q_COMPILER_EXPLICIT_OVERRIDES
331# define Q_COMPILER_EXTERN_TEMPLATES
332# define Q_COMPILER_INHERITING_CONSTRUCTORS
333# define Q_COMPILER_INITIALIZER_LISTS
334# define Q_COMPILER_LAMBDA
335# define Q_COMPILER_NONSTATIC_MEMBER_INIT
336# define Q_COMPILER_NOEXCEPT
337# define Q_COMPILER_NULLPTR
338# define Q_COMPILER_RANGE_FOR
339# define Q_COMPILER_RAW_STRINGS
340# define Q_COMPILER_REF_QUALIFIERS
341# define Q_COMPILER_RVALUE_REFS
342# define Q_COMPILER_STATIC_ASSERT
343# define Q_COMPILER_TEMPLATE_ALIAS
344# define Q_COMPILER_THREAD_LOCAL
345# define Q_COMPILER_UDL
346# define Q_COMPILER_UNICODE_STRINGS
347# define Q_COMPILER_UNIFORM_INIT
348# define Q_COMPILER_UNRESTRICTED_UNIONS
349# define Q_COMPILER_VARIADIC_MACROS
350# define Q_COMPILER_VARIADIC_TEMPLATES
354# elif defined(__DCC__)
357# error "Compiler not supported"
361# elif defined(__USLC__) && defined(__SCO_VERSION__)
364# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
365# define Q_OUTOFLINE_TEMPLATE inline
369# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
380#elif defined(_DIAB_TOOL)
382# define Q_FUNC_INFO __PRETTY_FUNCTION__
385#elif defined(__HIGHC__)
388#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
390# define Q_COMPILER_MANGLES_RETURN_TYPE
395# if __SUNPRO_CC >= 0x500
396# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
398# if __SUNPRO_CC >= 0x590
399# define Q_TYPEOF(expr) __typeof__(expr)
401# if __SUNPRO_CC >= 0x550
402# define Q_DECL_EXPORT __global
405# error "Compiler not supported"
409# error "Compiler not supported"
418# error "Compiler not supported"
420# define Q_BROKEN_TEMPLATE_SPECIALIZATION
423# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
433# define __has_builtin(x) 0
436# define __has_feature(x) 0
438#ifndef __has_attribute
439# define __has_attribute(x) 0
441#ifndef __has_cpp_attribute
442# define __has_cpp_attribute(x) 0
445# define __has_include(x) 0
447#ifndef __has_include_next
448# define __has_include_next(x) 0
457#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
458# define QT_ASAN_ENABLED
462# if __has_include(<version>)
523#define Q_COMPILER_THREADSAFE_STATICS
525#if defined(Q_CC_CLANG)
527# define Q_COMPILER_RESTRICTED_VLA
528# if __has_feature(attribute_deprecated_with_message)
529# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
534# if __has_extension(cxx_binary_literals)
535# define Q_COMPILER_BINARY_LITERALS
539# if Q_CC_CLANG >= 209
540# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
541 || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
542 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
543# define Q_COMPILER_VARIADIC_MACROS
548# if (defined(__cplusplus) && __cplusplus >= 201103L) \
549 || defined(__GXX_EXPERIMENTAL_CXX0X__)
551# if __has_feature(cxx_alignas)
552# define Q_COMPILER_ALIGNAS
553# define Q_COMPILER_ALIGNOF
555# if __has_feature(cxx_atomic) && __has_include(<atomic>)
556# define Q_COMPILER_ATOMICS
558# if __has_feature(cxx_attributes)
559# define Q_COMPILER_ATTRIBUTES
561# if __has_feature(cxx_auto_type)
562# define Q_COMPILER_AUTO_FUNCTION
563# define Q_COMPILER_AUTO_TYPE
565# if __has_feature(cxx_strong_enums)
566# define Q_COMPILER_CLASS_ENUM
568# if __has_feature(cxx_constexpr) && Q_CC_CLANG > 302
569# define Q_COMPILER_CONSTEXPR
571# if __has_feature(cxx_decltype)
572# define Q_COMPILER_DECLTYPE
574# if __has_feature(cxx_defaulted_functions)
575# define Q_COMPILER_DEFAULT_MEMBERS
577# if __has_feature(cxx_deleted_functions)
578# define Q_COMPILER_DELETE_MEMBERS
580# if __has_feature(cxx_delegating_constructors)
581# define Q_COMPILER_DELEGATING_CONSTRUCTORS
583# if __has_feature(cxx_explicit_conversions)
584# define Q_COMPILER_EXPLICIT_CONVERSIONS
586# if __has_feature(cxx_override_control)
587# define Q_COMPILER_EXPLICIT_OVERRIDES
589# if __has_feature(cxx_inheriting_constructors)
590# define Q_COMPILER_INHERITING_CONSTRUCTORS
592# if __has_feature(cxx_generalized_initializers)
593# define Q_COMPILER_INITIALIZER_LISTS
594# define Q_COMPILER_UNIFORM_INIT
596# if __has_feature(cxx_lambdas)
597# define Q_COMPILER_LAMBDA
599# if __has_feature(cxx_noexcept)
600# define Q_COMPILER_NOEXCEPT
602# if __has_feature(cxx_nonstatic_member_init)
603# define Q_COMPILER_NONSTATIC_MEMBER_INIT
605# if __has_feature(cxx_nullptr)
606# define Q_COMPILER_NULLPTR
608# if __has_feature(cxx_range_for)
609# define Q_COMPILER_RANGE_FOR
611# if __has_feature(cxx_raw_string_literals)
612# define Q_COMPILER_RAW_STRINGS
614# if __has_feature(cxx_reference_qualified_functions)
615# define Q_COMPILER_REF_QUALIFIERS
617# if __has_feature(cxx_rvalue_references)
618# define Q_COMPILER_RVALUE_REFS
620# if __has_feature(cxx_static_assert)
621# define Q_COMPILER_STATIC_ASSERT
623# if __has_feature(cxx_alias_templates)
624# define Q_COMPILER_TEMPLATE_ALIAS
626# if __has_feature(cxx_thread_local)
627# if !defined(__FreeBSD__)
628# define Q_COMPILER_THREAD_LOCAL
631# if __has_feature(cxx_user_literals)
632# define Q_COMPILER_UDL
634# if __has_feature(cxx_unicode_literals)
635# define Q_COMPILER_UNICODE_STRINGS
637# if __has_feature(cxx_unrestricted_unions)
638# define Q_COMPILER_UNRESTRICTED_UNIONS
640# if __has_feature(cxx_variadic_templates)
641# define Q_COMPILER_VARIADIC_TEMPLATES
644# if Q_CC_CLANG >= 209
645# define Q_COMPILER_EXTERN_TEMPLATES
650# if defined(__cplusplus) && __cplusplus > 201103L
654# if __has_feature(cxx_generic_lambda)
655# define Q_COMPILER_GENERIC_LAMBDA
657# if __has_feature(cxx_init_capture)
658# define Q_COMPILER_LAMBDA_CAPTURES
660# if __has_feature(cxx_relaxed_constexpr)
661# define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
663# if __has_feature(cxx_decltype_auto) && __has_feature(cxx_return_type_deduction)
664# define Q_COMPILER_RETURN_TYPE_DEDUCTION
666# if __has_feature(cxx_variable_templates)
667# define Q_COMPILER_VARIABLE_TEMPLATES
669# if __has_feature(cxx_runtime_array)
670# define Q_COMPILER_VLA
674# if defined(__STDC_VERSION__)
675# if __has_feature(c_static_assert)
676# define Q_COMPILER_STATIC_ASSERT
678# if __has_feature(c_thread_local) && __has_include(<threads.h>)
679# if !defined(__FreeBSD__)
680# define Q_COMPILER_THREAD_LOCAL
685# ifndef Q_DECL_UNUSED
686# define Q_DECL_UNUSED __attribute__((__unused__))
688# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
691#if defined(Q_CC_GNU_ONLY)
692# define Q_COMPILER_RESTRICTED_VLA
695# define Q_COMPILER_BINARY_LITERALS
697# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
698 || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
699 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
701# define Q_COMPILER_VARIADIC_MACROS
703# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
706# define Q_COMPILER_DECLTYPE
707# define Q_COMPILER_RVALUE_REFS
708# define Q_COMPILER_STATIC_ASSERT
712# define Q_COMPILER_AUTO_FUNCTION
713# define Q_COMPILER_AUTO_TYPE
714# define Q_COMPILER_EXTERN_TEMPLATES
715# define Q_COMPILER_UNIFORM_INIT
716# define Q_COMPILER_UNICODE_STRINGS
717# define Q_COMPILER_VARIADIC_TEMPLATES
721# define Q_COMPILER_EXPLICIT_CONVERSIONS
724# define Q_COMPILER_INITIALIZER_LISTS
725# define Q_COMPILER_LAMBDA
726# define Q_COMPILER_RAW_STRINGS
727# define Q_COMPILER_CLASS_ENUM
733# define Q_COMPILER_DEFAULT_MEMBERS
734# define Q_COMPILER_DELETE_MEMBERS
736# define Q_COMPILER_NULLPTR
737# define Q_COMPILER_UNRESTRICTED_UNIONS
738# define Q_COMPILER_RANGE_FOR
745# define Q_COMPILER_ATOMICS
748# define Q_COMPILER_NOEXCEPT
750# define Q_COMPILER_NONSTATIC_MEMBER_INIT
751# define Q_COMPILER_DELEGATING_CONSTRUCTORS
752# define Q_COMPILER_EXPLICIT_OVERRIDES
753# define Q_COMPILER_TEMPLATE_ALIAS
754# define Q_COMPILER_UDL
757# define Q_COMPILER_ATTRIBUTES
758# define Q_COMPILER_ALIGNAS
759# define Q_COMPILER_ALIGNOF
760# define Q_COMPILER_INHERITING_CONSTRUCTORS
761# define Q_COMPILER_THREAD_LOCAL
762# if Q_CC_GNU > 408 || __GNUC_PATCHLEVEL__ >= 1
763# define Q_COMPILER_REF_QUALIFIERS
769# define Q_COMPILER_CONSTEXPR
772# if __cplusplus > 201103L
776# define Q_COMPILER_LAMBDA_CAPTURES
777# define Q_COMPILER_RETURN_TYPE_DEDUCTION
780# if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
783# define Q_COMPILER_STATIC_ASSERT
785# if Q_CC_GNU >= 409 && defined(__has_include)
787# if __has_include(<threads.h>)
788# define Q_COMPILER_THREAD_LOCAL
794#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
795# if defined(__cplusplus)
797# define Q_COMPILER_VARIADIC_MACROS
809# define Q_COMPILER_AUTO_FUNCTION
810# define Q_COMPILER_AUTO_TYPE
811# define Q_COMPILER_DECLTYPE
812# define Q_COMPILER_EXTERN_TEMPLATES
813# define Q_COMPILER_LAMBDA
814# define Q_COMPILER_NULLPTR
815# define Q_COMPILER_RVALUE_REFS
816# define Q_COMPILER_STATIC_ASSERT
818# define Q_COMPILER_EXPLICIT_OVERRIDES
819# define Q_COMPILER_CLASS_ENUM
820# define Q_COMPILER_ATOMICS
822# define Q_COMPILER_DELETE_MEMBERS
823# define Q_COMPILER_DELEGATING_CONSTRUCTORS
824# define Q_COMPILER_EXPLICIT_CONVERSIONS
825# define Q_COMPILER_NONSTATIC_MEMBER_INIT
826# define Q_COMPILER_RAW_STRINGS
827# define Q_COMPILER_TEMPLATE_ALIAS
828# define Q_COMPILER_VARIADIC_TEMPLATES
829# define Q_COMPILER_INITIALIZER_LISTS
831# define Q_COMPILER_DEFAULT_MEMBERS
832# define Q_COMPILER_ALIGNAS
833# define Q_COMPILER_ALIGNOF
834# define Q_COMPILER_INHERITING_CONSTRUCTORS
835# define Q_COMPILER_NOEXCEPT
836# define Q_COMPILER_RANGE_FOR
837# define Q_COMPILER_REF_QUALIFIERS
838# define Q_COMPILER_THREAD_LOCAL
839# define Q_COMPILER_UDL
840# define Q_COMPILER_UNICODE_STRINGS
841# define Q_COMPILER_UNRESTRICTED_UNIONS
842# if _MSC_FULL_VER >= 190023419
843# define Q_COMPILER_ATTRIBUTES
846# define Q_COMPILER_UNIFORM_INIT
849# define Q_COMPILER_CONSTEXPR
854#ifdef Q_COMPILER_UNICODE_STRINGS
855# define Q_STDLIB_UNICODE_STRINGS
856#elif defined(__cplusplus)
857# error "Qt6 requires Unicode string support in both the compiler and the standard library"
862# if defined(Q_OS_QNX)
871# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
877# if !defined(_HAS_CPP0X) || !_HAS_CPP0X
879# undef Q_COMPILER_INITIALIZER_LISTS
880# undef Q_COMPILER_RVALUE_REFS
881# undef Q_COMPILER_REF_QUALIFIERS
882# undef Q_COMPILER_NOEXCEPT
884# undef Q_STDLIB_UNICODE_STRINGS
886# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
887# undef Q_COMPILER_NULLPTR
889# if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
892# undef Q_COMPILER_CONSTEXPR
896# if defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
897# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
900# undef Q_COMPILER_INITIALIZER_LISTS
901# undef Q_COMPILER_RVALUE_REFS
902# undef Q_COMPILER_REF_QUALIFIERS
904# undef Q_COMPILER_ATOMICS
906# if defined(__cpp_lib_memory_resource) \
907 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \
908 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000))
909# undef __cpp_lib_memory_resource
915#if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
916# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
923#define Q_ALIGNOF(x) alignof(x)
924#define Q_DECL_ALIGN(n) alignas(n)
925#define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
927# define Q_CONSTEXPR constexpr
928# define Q_DECL_CONSTEXPR constexpr
929# define Q_DECL_EQ_DEFAULT = default
930# define Q_DECL_EQ_DELETE = delete
931# define Q_DECL_FINAL final
932# define Q_DECL_NOEXCEPT noexcept
933# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
934# define Q_DECL_OVERRIDE override
935# define Q_DECL_RELAXED_CONSTEXPR constexpr
936# define Q_NULLPTR nullptr
937# define Q_RELAXED_CONSTEXPR constexpr
939# define Q_CONSTEXPR const
940# define Q_DECL_CONSTEXPR
941# define Q_DECL_RELAXED_CONSTEXPR
942# define Q_NULLPTR NULL
943# define Q_RELAXED_CONSTEXPR const
945# define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
947# define Q_DECL_NOEXCEPT
951#if __has_cpp_attribute(nodiscard) && (!defined(Q_CC_CLANG) || __cplusplus > 201402L)
953# undef Q_REQUIRED_RESULT
954# define Q_REQUIRED_RESULT [[nodiscard]]
957#if __has_cpp_attribute(nodiscard) >= 201907L
959# ifndef Q_NODISCARD_CTOR
960# define Q_NODISCARD_CTOR [[nodiscard]]
963# ifndef Q_NODISCARD_X
964# define Q_NODISCARD_X(message) [[nodiscard(message)]]
966# ifndef Q_NODISCARD_CTOR_X
967# define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
971#if __has_cpp_attribute(maybe_unused)
973# define Q_DECL_UNUSED [[maybe_unused]]
976#if __has_cpp_attribute(noreturn)
978# define Q_NORETURN [[noreturn]]
981#if __has_cpp_attribute(deprecated)
982# ifdef Q_DECL_DEPRECATED
983# undef Q_DECL_DEPRECATED
985# ifdef Q_DECL_DEPRECATED_X
986# undef Q_DECL_DEPRECATED_X
988# define Q_DECL_DEPRECATED [[deprecated]]
989# define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
992#define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
993#define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
1003# define Q_LIKELY(x) (x)
1006# define Q_UNLIKELY(x) (x)
1008#ifndef Q_ASSUME_IMPL
1009# define Q_ASSUME_IMPL(expr) qt_noop()
1011#ifndef Q_UNREACHABLE_IMPL
1012# define Q_UNREACHABLE_IMPL() qt_noop()
1015# define Q_ALLOC_SIZE(x)
1017#ifndef Q_REQUIRED_RESULT
1018# define Q_REQUIRED_RESULT
1020#ifndef Q_NODISCARD_X
1021# define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1023#ifndef Q_NODISCARD_CTOR
1024# define Q_NODISCARD_CTOR
1026#ifndef Q_NODISCARD_CTOR_X
1027# define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1029#ifndef Q_DECL_DEPRECATED
1030# define Q_DECL_DEPRECATED
1032#ifndef Q_DECL_VARIABLE_DEPRECATED
1033# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
1035#ifndef Q_DECL_DEPRECATED_X
1036# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1038#ifndef Q_DECL_EXPORT
1039# define Q_DECL_EXPORT
1041#ifndef Q_DECL_EXPORT_OVERRIDABLE
1042# define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1044#ifndef Q_DECL_IMPORT
1045# define Q_DECL_IMPORT
1047#ifndef Q_DECL_HIDDEN
1048# define Q_DECL_HIDDEN
1050#ifndef Q_DECL_UNUSED
1051# define Q_DECL_UNUSED
1053#ifndef Q_DECL_UNUSED_MEMBER
1054# define Q_DECL_UNUSED_MEMBER
1057# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1058# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1060# define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1063#ifndef Q_DECL_CF_RETURNS_RETAINED
1064# define Q_DECL_CF_RETURNS_RETAINED
1066#ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1067# define Q_DECL_NS_RETURNS_AUTORELEASED
1069#ifndef Q_DECL_PURE_FUNCTION
1070# define Q_DECL_PURE_FUNCTION
1072#ifndef Q_DECL_CONST_FUNCTION
1073# define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1075#ifndef Q_DECL_COLD_FUNCTION
1076# define Q_DECL_COLD_FUNCTION
1078#ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1079# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1081#ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1082# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1090# define Q_WEAK_OVERLOAD template <typename = void>
1092# define Q_WEAK_OVERLOAD
1114# define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1116# define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1123#define QT_DO_PRAGMA(text) _Pragma(#text)
1124#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1126# define QT_WARNING_PUSH __pragma(warning(push))
1127# define QT_WARNING_POP __pragma(warning(pop))
1128# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1129# define QT_WARNING_DISABLE_INTEL(number)
1130# define QT_WARNING_DISABLE_CLANG(text)
1131# define QT_WARNING_DISABLE_GCC(text)
1132# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996)
1133# define QT_WARNING_DISABLE_FLOAT_COMPARE
1134# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1135#elif defined(Q_CC_CLANG)
1136# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1137# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1138# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1139# define QT_WARNING_DISABLE_GCC(text)
1140# define QT_WARNING_DISABLE_INTEL(number)
1141# define QT_WARNING_DISABLE_MSVC(number)
1142# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
1143# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
1144# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_CLANG("-Winvalid-offsetof")
1145#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
1146# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1147# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1148# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1149# define QT_WARNING_DISABLE_CLANG(text)
1150# define QT_WARNING_DISABLE_INTEL(number)
1151# define QT_WARNING_DISABLE_MSVC(number)
1152# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1153# define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1154# define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1156# define QT_WARNING_DISABLE_GCC(text)
1157# define QT_WARNING_PUSH
1158# define QT_WARNING_POP
1159# define QT_WARNING_DISABLE_INTEL(number)
1160# define QT_WARNING_DISABLE_MSVC(number)
1161# define QT_WARNING_DISABLE_CLANG(text)
1162# define QT_WARNING_DISABLE_GCC(text)
1163# define QT_WARNING_DISABLE_DEPRECATED
1164# define QT_WARNING_DISABLE_FLOAT_COMPARE
1165# define QT_WARNING_DISABLE_INVALID_OFFSETOF
1168#ifndef QT_IGNORE_DEPRECATIONS
1169#define QT_IGNORE_DEPRECATIONS(statement) \
1171 QT_WARNING_DISABLE_DEPRECATED \
1177#define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
1183#define Q_OFFSETOF(Class, member) \
1185 QT_WARNING_PUSH QT_WARNING_DISABLE_INVALID_OFFSETOF \
1186 return offsetof(Class, member); \
1193#ifndef QT_NO_KEYWORDS
1194# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1195# define for if (0) {} else for
1199#ifdef Q_COMPILER_RVALUE_REFS
1200#define qMove(x) std::move(x)
1205#if defined(__cplusplus)
1206#if __has_cpp_attribute(clang::fallthrough)
1207# define Q_FALLTHROUGH() [[clang::fallthrough]]
1208#elif __has_cpp_attribute(gnu::fallthrough)
1209# define Q_FALLTHROUGH() [[gnu::fallthrough]]
1210#elif __has_cpp_attribute(fallthrough)
1211# define Q_FALLTHROUGH() [[fallthrough]]
1214#ifndef Q_FALLTHROUGH
1215# if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 700
1216# define Q_FALLTHROUGH() __attribute__((fallthrough))
1218# define Q_FALLTHROUGH() (void)0
1226#if !defined(Q_PROCESSOR_X86)
1227# undef QT_COMPILER_SUPPORTS_SSE2
1228# undef QT_COMPILER_SUPPORTS_SSE3
1229# undef QT_COMPILER_SUPPORTS_SSSE3
1230# undef QT_COMPILER_SUPPORTS_SSE4_1
1231# undef QT_COMPILER_SUPPORTS_SSE4_2
1232# undef QT_COMPILER_SUPPORTS_AVX
1233# undef QT_COMPILER_SUPPORTS_AVX2
1234# undef QT_COMPILER_SUPPORTS_F16C
1236#if !defined(Q_PROCESSOR_ARM)
1237# undef QT_COMPILER_SUPPORTS_NEON
1239#if !defined(Q_PROCESSOR_MIPS)
1240# undef QT_COMPILER_SUPPORTS_MIPS_DSP
1241# undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1245#if defined(__cplusplus) && (__cplusplus < 201703L)
1247# 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."
1249# error "Qt requires a C++17 compiler"
1253#if defined(__cplusplus) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1254# if Q_CC_MSVC < 1927
1256# error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1263static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
1264 "On MSVC you must pass the /permissive- option to the compiler.");
1267#if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__)
1269#elif defined(QT_REDUCE_RELOCATIONS)
1270# error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "\
1271 "Compile your code with -fPIC (and not with -fPIE)."
1274#ifdef Q_PROCESSOR_X86_32
1275# if defined(Q_CC_GNU)
1276# define QT_FASTCALL __attribute__((regparm(3)))
1277# elif defined(Q_CC_MSVC)
1278# define QT_FASTCALL __fastcall
1287#if defined(Q_CC_GNU) && !defined(__INSURE__)
1288# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
1289# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
1290 __attribute__((format(gnu_printf, (A), (B))))
1292# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
1293 __attribute__((format(printf, (A), (B))))
1296# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1300# define Q_NEVER_INLINE __declspec(noinline)
1301# define Q_ALWAYS_INLINE __forceinline
1302#elif defined(Q_CC_GNU)
1303# define Q_NEVER_INLINE __attribute__((noinline))
1304# define Q_ALWAYS_INLINE inline __attribute__((always_inline))
1306# define Q_NEVER_INLINE
1307# define Q_ALWAYS_INLINE inline
1312#if defined(Q_OS_WIN)
1313# if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
1314# define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1316# define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1318# define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1321#ifdef __cpp_conditional_explicit
1322#define Q_IMPLICIT explicit(false)
1327#if defined(__cplusplus)
1329#ifdef __cpp_constinit
1330# if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1334# define Q_CONSTINIT constinit
1336#elif defined(__has_cpp_attribute) && __has_cpp_attribute(clang::require_constant_initialization)
1337# define Q_CONSTINIT [[clang::require_constant_initialization]]
1338#elif defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1000
1339# define Q_CONSTINIT __constinit
1344#ifndef Q_OUTOFLINE_TEMPLATE
1345# define Q_OUTOFLINE_TEMPLATE
1347#ifndef Q_INLINE_TEMPLATE
1348# define Q_INLINE_TEMPLATE inline
1356#if !defined(QT_CC_WARNINGS)
1357# define QT_NO_WARNINGS
1359#if defined(QT_NO_WARNINGS)
1360# if defined(Q_CC_MSVC)
1371# elif defined(Q_CC_BOR)
1372# pragma option -w-inl
1373# pragma option -w-aus
1382#if !defined(QT_NO_EXCEPTIONS)
1383# if !defined(Q_MOC_RUN)
1384# if defined(Q_CC_GNU) && !defined(__cpp_exceptions)
1385# define QT_NO_EXCEPTIONS
1387# elif defined(QT_BOOTSTRAPPED)
1388# define QT_NO_EXCEPTIONS
1392#if defined(__cplusplus) && __cplusplus >= 202002L
1393# define QT_COMPILER_HAS_P0846
1396#ifdef QT_COMPILER_HAS_P0846
1397# define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1399 class QT_CLASS_JUST_FOR_P0846_SIMULATION;
1400# define QT_ENABLE_P0846_SEMANTICS_FOR(func) \
1401 template <typename T> \
1402 void func (QT_CLASS_JUST_FOR_P0846_SIMULATION *); \
#define QT_WARNING_DISABLE_MSVC(number)