File indexing completed on 2025-01-18 10:07:20
0001
0002
0003
0004
0005 #if 0
0006 #pragma qt_class(QtCompilerDetection)
0007 #pragma qt_sync_skip_header_check
0008 #pragma qt_sync_stop_processing
0009 #endif
0010
0011 #ifndef QCOMPILERDETECTION_H
0012 #define QCOMPILERDETECTION_H
0013
0014 #include <QtCore/qprocessordetection.h>
0015 #include <QtCore/qsystemdetection.h>
0016 #include <QtCore/qtconfiginclude.h>
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 #if defined(__COVERITY__)
0049 # define Q_CC_COVERITY
0050 # define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
0051 #endif
0052
0053
0054 #if defined(__DMC__) || defined(__SC__)
0055 # define Q_CC_SYM
0056
0057 # if defined(__SC__) && __SC__ < 0x750
0058 # error "Compiler not supported"
0059 # endif
0060
0061 #elif defined(_MSC_VER)
0062 # define Q_CC_MSVC (_MSC_VER)
0063 # define Q_CC_MSVC_NET
0064 # define Q_CC_MSVC_ONLY Q_CC_MSVC
0065 # ifdef __clang__
0066 # undef Q_CC_MSVC_ONLY
0067 # define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
0068 # define Q_CC_CLANG_ONLY Q_CC_CLANG
0069 # endif
0070 # define Q_OUTOFLINE_TEMPLATE inline
0071 # define Q_COMPILER_MANGLES_RETURN_TYPE
0072 # define Q_COMPILER_MANGLES_ACCESS_SPECIFIER
0073 # define Q_FUNC_INFO __FUNCSIG__
0074 # define Q_ASSUME_IMPL(expr) __assume(expr)
0075 # define Q_UNREACHABLE_IMPL() __assume(0)
0076 # define Q_DECL_EXPORT __declspec(dllexport)
0077 # define Q_DECL_IMPORT __declspec(dllimport)
0078 # if _MSC_VER < 1938
0079 # define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N))
0080 # endif
0081 # define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
0082
0083 #elif defined(__BORLANDC__) || defined(__TURBOC__)
0084 # define Q_CC_BOR
0085 # define Q_INLINE_TEMPLATE
0086 # if __BORLANDC__ < 0x502
0087 # error "Compiler not supported"
0088 # endif
0089
0090 #elif defined(__WATCOMC__)
0091 # define Q_CC_WAT
0092
0093
0094
0095
0096 #elif defined(__ARMCC__) || defined(__CC_ARM)
0097 # define Q_CC_RVCT
0098
0099 # define __is_empty(X) false
0100 # define __is_pod(X) false
0101 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
0102 # ifdef Q_OS_LINUX
0103 # define Q_DECL_EXPORT __attribute__((visibility("default")))
0104 # define Q_DECL_IMPORT __attribute__((visibility("default")))
0105 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
0106 # else
0107 # define Q_DECL_EXPORT __declspec(dllexport)
0108 # define Q_DECL_IMPORT __declspec(dllimport)
0109 # endif
0110
0111 #elif defined(__GNUC__)
0112 # define Q_CC_GNU (__GNUC__ * 100 + __GNUC_MINOR__)
0113 # if defined(__MINGW32__)
0114 # define Q_CC_MINGW
0115 # endif
0116 # if defined(__clang__)
0117
0118 # if defined(__apple_build_version__)
0119
0120
0121
0122
0123
0124
0125 # if __apple_build_version__ >= 14030022
0126 # define Q_CC_CLANG 1500
0127 # elif __apple_build_version__ >= 14000029
0128 # define Q_CC_CLANG 1400
0129 # elif __apple_build_version__ >= 13160021
0130 # define Q_CC_CLANG 1300
0131 # elif __apple_build_version__ >= 13000029
0132 # define Q_CC_CLANG 1200
0133 # elif __apple_build_version__ >= 12050022
0134 # define Q_CC_CLANG 1110
0135 # elif __apple_build_version__ >= 12000032
0136 # define Q_CC_CLANG 1000
0137 # elif __apple_build_version__ >= 11030032
0138 # define Q_CC_CLANG 900
0139 # elif __apple_build_version__ >= 11000033
0140 # define Q_CC_CLANG 800
0141 # else
0142 # error "Unsupported Apple Clang version"
0143 # endif
0144 # else
0145
0146 # define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
0147 # endif
0148 # define Q_CC_CLANG_ONLY Q_CC_CLANG
0149 # if __has_builtin(__builtin_assume)
0150 # define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
0151 # else
0152 # define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
0153 # endif
0154 # define Q_UNREACHABLE_IMPL() __builtin_unreachable()
0155 # if !defined(__has_extension)
0156 #
0157 # define __has_extension __has_feature
0158 # endif
0159 # if defined(__APPLE__)
0160
0161 # define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
0162 # ifdef __OBJC__
0163 # define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
0164 # endif
0165 # endif
0166 # ifdef __EMSCRIPTEN__
0167 # define Q_CC_EMSCRIPTEN
0168 # endif
0169 # else
0170
0171 # define Q_CC_GNU_ONLY Q_CC_GNU
0172 # if Q_CC_GNU >= 405
0173 # define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
0174 # define Q_UNREACHABLE_IMPL() __builtin_unreachable()
0175 # define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
0176 # endif
0177 # endif
0178
0179 # ifdef Q_OS_WIN
0180 # define Q_DECL_EXPORT __declspec(dllexport)
0181 # define Q_DECL_IMPORT __declspec(dllimport)
0182 # else
0183 # define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
0184 # ifdef QT_USE_PROTECTED_VISIBILITY
0185 # define Q_DECL_EXPORT __attribute__((visibility("protected")))
0186 # else
0187 # define Q_DECL_EXPORT __attribute__((visibility("default")))
0188 # endif
0189 # define Q_DECL_IMPORT __attribute__((visibility("default")))
0190 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
0191 # endif
0192
0193 # define Q_FUNC_INFO __PRETTY_FUNCTION__
0194 # define Q_TYPEOF(expr) __typeof__(expr)
0195 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
0196 # define Q_DECL_UNUSED __attribute__((__unused__))
0197 # define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
0198 # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
0199 # define Q_NORETURN __attribute__((__noreturn__))
0200 # define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
0201 # define Q_DECL_PURE_FUNCTION __attribute__((pure))
0202 # define Q_DECL_CONST_FUNCTION __attribute__((const))
0203 # define Q_DECL_COLD_FUNCTION __attribute__((cold))
0204 # if !defined(QT_MOC_CPP)
0205 # define Q_PACKED __attribute__ ((__packed__))
0206 # ifndef __ARM_EABI__
0207 # define QT_NO_ARM_EABI
0208 # endif
0209 # endif
0210 # if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG)
0211 # define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
0212 # endif
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236 #elif defined(__xlC__)
0237 # define Q_CC_XLC
0238 # if __xlC__ < 0x400
0239 # error "Compiler not supported"
0240 # elif __xlC__ >= 0x0600
0241 # define Q_TYPEOF(expr) __typeof__(expr)
0242 # define Q_PACKED __attribute__((__packed__))
0243 # endif
0244
0245
0246
0247
0248
0249
0250 #elif defined(__DECCXX) || defined(__DECC)
0251 # define Q_CC_DEC
0252
0253
0254 # if defined(__EDG__)
0255 # define Q_CC_EDG
0256 # endif
0257
0258
0259
0260 # if !defined(_BOOL_EXISTS)
0261 # error "Compiler not supported"
0262 # endif
0263
0264
0265
0266 # if __DECCXX_VER < 60060000
0267 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
0268 # endif
0269
0270 # define Q_OUTOFLINE_TEMPLATE inline
0271
0272
0273
0274 #elif defined(__PGI)
0275 # define Q_CC_PGI
0276 # if defined(__EDG__)
0277 # define Q_CC_EDG
0278 # endif
0279
0280
0281
0282
0283
0284 #elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
0285 # define Q_CC_EDG
0286
0287
0288
0289
0290
0291
0292
0293 # if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
0294 # error "Compiler not supported"
0295 # endif
0296
0297
0298 # if defined(__COMO__)
0299 # define Q_CC_COMEAU
0300
0301
0302
0303
0304
0305 # elif defined(__KCC)
0306 # define Q_CC_KAI
0307
0308
0309 # elif defined(__ghs)
0310 # define Q_CC_GHS
0311 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
0312 # define Q_PACKED __attribute__ ((__packed__))
0313 # define Q_FUNC_INFO __PRETTY_FUNCTION__
0314 # define Q_TYPEOF(expr) __typeof__(expr)
0315 # define Q_UNREACHABLE_IMPL()
0316 # if defined(__cplusplus)
0317 # define Q_COMPILER_AUTO_TYPE
0318 # define Q_COMPILER_STATIC_ASSERT
0319 # define Q_COMPILER_RANGE_FOR
0320 # if __GHS_VERSION_NUMBER >= 201505
0321 # define Q_COMPILER_ALIGNAS
0322 # define Q_COMPILER_ALIGNOF
0323 # define Q_COMPILER_ATOMICS
0324 # define Q_COMPILER_ATTRIBUTES
0325 # define Q_COMPILER_AUTO_FUNCTION
0326 # define Q_COMPILER_CLASS_ENUM
0327 # define Q_COMPILER_DECLTYPE
0328 # define Q_COMPILER_DEFAULT_MEMBERS
0329 # define Q_COMPILER_DELETE_MEMBERS
0330 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0331 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0332 # define Q_COMPILER_EXPLICIT_OVERRIDES
0333 # define Q_COMPILER_EXTERN_TEMPLATES
0334 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0335 # define Q_COMPILER_INITIALIZER_LISTS
0336 # define Q_COMPILER_LAMBDA
0337 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0338 # define Q_COMPILER_NOEXCEPT
0339 # define Q_COMPILER_NULLPTR
0340 # define Q_COMPILER_RANGE_FOR
0341 # define Q_COMPILER_RAW_STRINGS
0342 # define Q_COMPILER_REF_QUALIFIERS
0343 # define Q_COMPILER_RVALUE_REFS
0344 # define Q_COMPILER_STATIC_ASSERT
0345 # define Q_COMPILER_TEMPLATE_ALIAS
0346 # define Q_COMPILER_THREAD_LOCAL
0347 # define Q_COMPILER_UDL
0348 # define Q_COMPILER_UNICODE_STRINGS
0349 # define Q_COMPILER_UNIFORM_INIT
0350 # define Q_COMPILER_UNRESTRICTED_UNIONS
0351 # define Q_COMPILER_VARIADIC_MACROS
0352 # define Q_COMPILER_VARIADIC_TEMPLATES
0353 # endif
0354 # endif
0355
0356 # elif defined(__DCC__)
0357 # define Q_CC_DIAB
0358 # if !defined(__bool)
0359 # error "Compiler not supported"
0360 # endif
0361
0362
0363 # elif defined(__USLC__) && defined(__SCO_VERSION__)
0364 # define Q_CC_USLC
0365
0366 # if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
0367 # define Q_OUTOFLINE_TEMPLATE inline
0368 # endif
0369
0370
0371 # elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
0372 # define Q_CC_OC
0373
0374
0375
0376 # elif defined(sinix)
0377 # define Q_CC_CDS
0378 # endif
0379
0380
0381
0382 #elif defined(_DIAB_TOOL)
0383 # define Q_CC_DIAB
0384 # define Q_FUNC_INFO __PRETTY_FUNCTION__
0385
0386
0387 #elif defined(__HIGHC__)
0388 # define Q_CC_HIGHC
0389
0390 #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
0391 # define Q_CC_SUN
0392 # define Q_COMPILER_MANGLES_RETURN_TYPE
0393
0394
0395
0396
0397 # if __SUNPRO_CC >= 0x500
0398 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
0399
0400 # if __SUNPRO_CC >= 0x590
0401 # define Q_TYPEOF(expr) __typeof__(expr)
0402 # endif
0403 # if __SUNPRO_CC >= 0x550
0404 # define Q_DECL_EXPORT __global
0405 # endif
0406 # if !defined(_BOOL)
0407 # error "Compiler not supported"
0408 # endif
0409
0410 # else
0411 # error "Compiler not supported"
0412 # endif
0413
0414
0415
0416 #elif defined(sinix)
0417 # define Q_CC_EDG
0418 # define Q_CC_CDS
0419 # if !defined(_BOOL)
0420 # error "Compiler not supported"
0421 # endif
0422 # define Q_BROKEN_TEMPLATE_SPECIALIZATION
0423
0424 #else
0425 # error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
0426 #endif
0427
0428
0429
0430
0431
0432
0433
0434 #ifndef __has_builtin
0435 # define __has_builtin(x) 0
0436 #endif
0437 #ifndef __has_feature
0438 # define __has_feature(x) 0
0439 #endif
0440 #ifndef __has_attribute
0441 # define __has_attribute(x) 0
0442 #endif
0443 #ifndef __has_cpp_attribute
0444 # define __has_cpp_attribute(x) 0
0445 #endif
0446 #ifndef __has_include
0447 # define __has_include(x) 0
0448 #endif
0449 #ifndef __has_include_next
0450 # define __has_include_next(x) 0
0451 #endif
0452
0453
0454
0455
0456
0457
0458
0459 #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
0460 # define QT_ASAN_ENABLED
0461 #endif
0462
0463 #ifdef __cplusplus
0464 # if __has_include(<version>)
0465 # include <version>
0466 # endif
0467 #endif
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508
0509
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519
0520
0521
0522
0523
0524
0525 #define Q_COMPILER_THREADSAFE_STATICS
0526
0527 #if defined(Q_CC_CLANG)
0528
0529 # define Q_COMPILER_RESTRICTED_VLA
0530 # if __has_feature(attribute_deprecated_with_message)
0531 # define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
0532 # endif
0533
0534
0535
0536 # if __has_extension(cxx_binary_literals)
0537 # define Q_COMPILER_BINARY_LITERALS
0538 # endif
0539
0540
0541 # if Q_CC_CLANG >= 209
0542 # if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
0543 || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
0544 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
0545 # define Q_COMPILER_VARIADIC_MACROS
0546 # endif
0547 # endif
0548
0549
0550 # if (defined(__cplusplus) && __cplusplus >= 201103L) \
0551 || defined(__GXX_EXPERIMENTAL_CXX0X__)
0552
0553 # if __has_feature(cxx_alignas)
0554 # define Q_COMPILER_ALIGNAS
0555 # define Q_COMPILER_ALIGNOF
0556 # endif
0557 # if __has_feature(cxx_atomic) && __has_include(<atomic>)
0558 # define Q_COMPILER_ATOMICS
0559 # endif
0560 # if __has_feature(cxx_attributes)
0561 # define Q_COMPILER_ATTRIBUTES
0562 # endif
0563 # if __has_feature(cxx_auto_type)
0564 # define Q_COMPILER_AUTO_FUNCTION
0565 # define Q_COMPILER_AUTO_TYPE
0566 # endif
0567 # if __has_feature(cxx_strong_enums)
0568 # define Q_COMPILER_CLASS_ENUM
0569 # endif
0570 # if __has_feature(cxx_constexpr) && Q_CC_CLANG > 302
0571 # define Q_COMPILER_CONSTEXPR
0572 # endif
0573 # if __has_feature(cxx_decltype)
0574 # define Q_COMPILER_DECLTYPE
0575 # endif
0576 # if __has_feature(cxx_defaulted_functions)
0577 # define Q_COMPILER_DEFAULT_MEMBERS
0578 # endif
0579 # if __has_feature(cxx_deleted_functions)
0580 # define Q_COMPILER_DELETE_MEMBERS
0581 # endif
0582 # if __has_feature(cxx_delegating_constructors)
0583 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0584 # endif
0585 # if __has_feature(cxx_explicit_conversions)
0586 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0587 # endif
0588 # if __has_feature(cxx_override_control)
0589 # define Q_COMPILER_EXPLICIT_OVERRIDES
0590 # endif
0591 # if __has_feature(cxx_inheriting_constructors)
0592 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0593 # endif
0594 # if __has_feature(cxx_generalized_initializers)
0595 # define Q_COMPILER_INITIALIZER_LISTS
0596 # define Q_COMPILER_UNIFORM_INIT
0597 # endif
0598 # if __has_feature(cxx_lambdas)
0599 # define Q_COMPILER_LAMBDA
0600 # endif
0601 # if __has_feature(cxx_noexcept)
0602 # define Q_COMPILER_NOEXCEPT
0603 # endif
0604 # if __has_feature(cxx_nonstatic_member_init)
0605 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0606 # endif
0607 # if __has_feature(cxx_nullptr)
0608 # define Q_COMPILER_NULLPTR
0609 # endif
0610 # if __has_feature(cxx_range_for)
0611 # define Q_COMPILER_RANGE_FOR
0612 # endif
0613 # if __has_feature(cxx_raw_string_literals)
0614 # define Q_COMPILER_RAW_STRINGS
0615 # endif
0616 # if __has_feature(cxx_reference_qualified_functions)
0617 # define Q_COMPILER_REF_QUALIFIERS
0618 # endif
0619 # if __has_feature(cxx_rvalue_references)
0620 # define Q_COMPILER_RVALUE_REFS
0621 # endif
0622 # if __has_feature(cxx_static_assert)
0623 # define Q_COMPILER_STATIC_ASSERT
0624 # endif
0625 # if __has_feature(cxx_alias_templates)
0626 # define Q_COMPILER_TEMPLATE_ALIAS
0627 # endif
0628 # if __has_feature(cxx_thread_local)
0629 # if !defined(__FreeBSD__)
0630 # define Q_COMPILER_THREAD_LOCAL
0631 # endif
0632 # endif
0633 # if __has_feature(cxx_user_literals)
0634 # define Q_COMPILER_UDL
0635 # endif
0636 # if __has_feature(cxx_unicode_literals)
0637 # define Q_COMPILER_UNICODE_STRINGS
0638 # endif
0639 # if __has_feature(cxx_unrestricted_unions)
0640 # define Q_COMPILER_UNRESTRICTED_UNIONS
0641 # endif
0642 # if __has_feature(cxx_variadic_templates)
0643 # define Q_COMPILER_VARIADIC_TEMPLATES
0644 # endif
0645
0646 # if Q_CC_CLANG >= 209
0647 # define Q_COMPILER_EXTERN_TEMPLATES
0648 # endif
0649 # endif
0650
0651
0652 # if defined(__cplusplus) && __cplusplus > 201103L
0653
0654
0655
0656 # if __has_feature(cxx_generic_lambda)
0657 # define Q_COMPILER_GENERIC_LAMBDA
0658 # endif
0659 # if __has_feature(cxx_init_capture)
0660 # define Q_COMPILER_LAMBDA_CAPTURES
0661 # endif
0662 # if __has_feature(cxx_relaxed_constexpr)
0663 # define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
0664 # endif
0665 # if __has_feature(cxx_decltype_auto) && __has_feature(cxx_return_type_deduction)
0666 # define Q_COMPILER_RETURN_TYPE_DEDUCTION
0667 # endif
0668 # if __has_feature(cxx_variable_templates)
0669 # define Q_COMPILER_VARIABLE_TEMPLATES
0670 # endif
0671 # if __has_feature(cxx_runtime_array)
0672 # define Q_COMPILER_VLA
0673 # endif
0674 # endif
0675
0676 # if defined(__STDC_VERSION__)
0677 # if __has_feature(c_static_assert)
0678 # define Q_COMPILER_STATIC_ASSERT
0679 # endif
0680 # if __has_feature(c_thread_local) && __has_include(<threads.h>)
0681 # if !defined(__FreeBSD__)
0682 # define Q_COMPILER_THREAD_LOCAL
0683 # endif
0684 # endif
0685 # endif
0686
0687 # ifndef Q_DECL_UNUSED
0688 # define Q_DECL_UNUSED __attribute__((__unused__))
0689 # endif
0690 # define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
0691 #endif
0692
0693 #if defined(Q_CC_GNU_ONLY)
0694 # define Q_COMPILER_RESTRICTED_VLA
0695 # if Q_CC_GNU >= 403
0696
0697 # define Q_COMPILER_BINARY_LITERALS
0698 # endif
0699 # if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
0700 || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
0701 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
0702
0703 # define Q_COMPILER_VARIADIC_MACROS
0704 # endif
0705 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
0706 # if Q_CC_GNU >= 403
0707
0708 # define Q_COMPILER_DECLTYPE
0709 # define Q_COMPILER_RVALUE_REFS
0710 # define Q_COMPILER_STATIC_ASSERT
0711 # endif
0712 # if Q_CC_GNU >= 404
0713
0714 # define Q_COMPILER_AUTO_FUNCTION
0715 # define Q_COMPILER_AUTO_TYPE
0716 # define Q_COMPILER_EXTERN_TEMPLATES
0717 # define Q_COMPILER_UNIFORM_INIT
0718 # define Q_COMPILER_UNICODE_STRINGS
0719 # define Q_COMPILER_VARIADIC_TEMPLATES
0720 # endif
0721 # if Q_CC_GNU >= 405
0722
0723 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0724
0725
0726 # define Q_COMPILER_INITIALIZER_LISTS
0727 # define Q_COMPILER_LAMBDA
0728 # define Q_COMPILER_RAW_STRINGS
0729 # define Q_COMPILER_CLASS_ENUM
0730 # endif
0731 # if Q_CC_GNU >= 406
0732
0733
0734
0735 # define Q_COMPILER_DEFAULT_MEMBERS
0736 # define Q_COMPILER_DELETE_MEMBERS
0737
0738 # define Q_COMPILER_NULLPTR
0739 # define Q_COMPILER_UNRESTRICTED_UNIONS
0740 # define Q_COMPILER_RANGE_FOR
0741 # endif
0742 # if Q_CC_GNU >= 407
0743
0744
0745
0746
0747 # define Q_COMPILER_ATOMICS
0748
0749
0750 # define Q_COMPILER_NOEXCEPT
0751
0752 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0753 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0754 # define Q_COMPILER_EXPLICIT_OVERRIDES
0755 # define Q_COMPILER_TEMPLATE_ALIAS
0756 # define Q_COMPILER_UDL
0757 # endif
0758 # if Q_CC_GNU >= 408
0759 # define Q_COMPILER_ATTRIBUTES
0760 # define Q_COMPILER_ALIGNAS
0761 # define Q_COMPILER_ALIGNOF
0762 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0763 # define Q_COMPILER_THREAD_LOCAL
0764 # if Q_CC_GNU > 408 || __GNUC_PATCHLEVEL__ >= 1
0765 # define Q_COMPILER_REF_QUALIFIERS
0766 # endif
0767 # endif
0768 # if Q_CC_GNU >= 500
0769
0770
0771 # define Q_COMPILER_CONSTEXPR
0772 # endif
0773 # endif
0774 # if __cplusplus > 201103L
0775 # if Q_CC_GNU >= 409
0776
0777
0778 # define Q_COMPILER_LAMBDA_CAPTURES
0779 # define Q_COMPILER_RETURN_TYPE_DEDUCTION
0780 # endif
0781 # endif
0782 # if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
0783 # if Q_CC_GNU >= 407
0784
0785 # define Q_COMPILER_STATIC_ASSERT
0786 # endif
0787 # if Q_CC_GNU >= 409 && defined(__has_include)
0788
0789 # if __has_include(<threads.h>)
0790 # define Q_COMPILER_THREAD_LOCAL
0791 # endif
0792 # endif
0793 # endif
0794 #endif
0795
0796 #if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
0797 # if defined(__cplusplus)
0798
0799 # define Q_COMPILER_VARIADIC_MACROS
0800
0801
0802
0803
0804
0805
0806
0807
0808
0809
0810
0811 # define Q_COMPILER_AUTO_FUNCTION
0812 # define Q_COMPILER_AUTO_TYPE
0813 # define Q_COMPILER_DECLTYPE
0814 # define Q_COMPILER_EXTERN_TEMPLATES
0815 # define Q_COMPILER_LAMBDA
0816 # define Q_COMPILER_NULLPTR
0817 # define Q_COMPILER_RVALUE_REFS
0818 # define Q_COMPILER_STATIC_ASSERT
0819
0820 # define Q_COMPILER_EXPLICIT_OVERRIDES
0821 # define Q_COMPILER_CLASS_ENUM
0822 # define Q_COMPILER_ATOMICS
0823
0824 # define Q_COMPILER_DELETE_MEMBERS
0825 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0826 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0827 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0828 # define Q_COMPILER_RAW_STRINGS
0829 # define Q_COMPILER_TEMPLATE_ALIAS
0830 # define Q_COMPILER_VARIADIC_TEMPLATES
0831 # define Q_COMPILER_INITIALIZER_LISTS
0832
0833 # define Q_COMPILER_DEFAULT_MEMBERS
0834 # define Q_COMPILER_ALIGNAS
0835 # define Q_COMPILER_ALIGNOF
0836 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0837 # define Q_COMPILER_NOEXCEPT
0838 # define Q_COMPILER_RANGE_FOR
0839 # define Q_COMPILER_REF_QUALIFIERS
0840 # define Q_COMPILER_THREAD_LOCAL
0841 # define Q_COMPILER_UDL
0842 # define Q_COMPILER_UNICODE_STRINGS
0843 # define Q_COMPILER_UNRESTRICTED_UNIONS
0844 # if _MSC_FULL_VER >= 190023419
0845 # define Q_COMPILER_ATTRIBUTES
0846
0847
0848 # define Q_COMPILER_UNIFORM_INIT
0849 # endif
0850 # if _MSC_VER >= 1910
0851 # define Q_COMPILER_CONSTEXPR
0852 # endif
0853
0854
0855
0856
0857 # if _MSC_VER < 1936
0858 # define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
0859 # endif
0860
0861 # define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
0862 # endif
0863 #endif
0864
0865 #ifdef Q_COMPILER_UNICODE_STRINGS
0866 # define Q_STDLIB_UNICODE_STRINGS
0867 #elif defined(__cplusplus)
0868 # error "Qt6 requires Unicode string support in both the compiler and the standard library"
0869 #endif
0870
0871 #ifdef __cplusplus
0872 # include <utility>
0873 # if defined(Q_OS_QNX)
0874
0875
0876
0877
0878
0879
0880
0881
0882 # if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
0883
0884
0885
0886
0887
0888 # if !defined(_HAS_CPP0X) || !_HAS_CPP0X
0889
0890 # undef Q_COMPILER_INITIALIZER_LISTS
0891 # undef Q_COMPILER_RVALUE_REFS
0892 # undef Q_COMPILER_REF_QUALIFIERS
0893 # undef Q_COMPILER_NOEXCEPT
0894
0895 # undef Q_STDLIB_UNICODE_STRINGS
0896 # endif
0897 # if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
0898 # undef Q_COMPILER_NULLPTR
0899 # endif
0900 # if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
0901
0902
0903 # undef Q_COMPILER_CONSTEXPR
0904 # endif
0905 # endif
0906 # endif
0907 # if defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
0908 # if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
0909
0910
0911 # undef Q_COMPILER_INITIALIZER_LISTS
0912 # undef Q_COMPILER_RVALUE_REFS
0913 # undef Q_COMPILER_REF_QUALIFIERS
0914
0915 # undef Q_COMPILER_ATOMICS
0916 # endif
0917 # if defined(__cpp_lib_memory_resource) \
0918 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \
0919 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000))
0920 # undef __cpp_lib_memory_resource
0921 # endif
0922 # endif
0923 #endif
0924
0925
0926 #if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
0927 # define Q_COMPILER_DEFAULT_DELETE_MEMBERS
0928 #endif
0929
0930
0931
0932
0933
0934 #define Q_ALIGNOF(x) alignof(x)
0935 #define Q_DECL_ALIGN(n) alignas(n)
0936 #define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
0937 #ifdef __cplusplus
0938 # define Q_CONSTEXPR constexpr
0939 # define Q_DECL_CONSTEXPR constexpr
0940 # define Q_DECL_EQ_DEFAULT = default
0941 # define Q_DECL_EQ_DELETE = delete
0942 # define Q_DECL_FINAL final
0943 # define Q_DECL_NOEXCEPT noexcept
0944 # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
0945 # define Q_DECL_OVERRIDE override
0946 # define Q_DECL_RELAXED_CONSTEXPR constexpr
0947 # define Q_NULLPTR nullptr
0948 # define Q_RELAXED_CONSTEXPR constexpr
0949 #else
0950 # define Q_CONSTEXPR const
0951 # define Q_DECL_CONSTEXPR
0952 # define Q_DECL_RELAXED_CONSTEXPR
0953 # define Q_NULLPTR NULL
0954 # define Q_RELAXED_CONSTEXPR const
0955 # ifdef Q_CC_GNU
0956 # define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
0957 # else
0958 # define Q_DECL_NOEXCEPT
0959 # endif
0960 #endif
0961
0962 #if __has_cpp_attribute(nodiscard) && (!defined(Q_CC_CLANG) || __cplusplus > 201402L)
0963
0964 # undef Q_REQUIRED_RESULT
0965 # define Q_REQUIRED_RESULT [[nodiscard]]
0966 #endif
0967
0968 #if __has_cpp_attribute(nodiscard) >= 201907L
0969
0970 # ifndef Q_NODISCARD_CTOR
0971 # define Q_NODISCARD_CTOR [[nodiscard]]
0972 # endif
0973
0974 # ifndef Q_NODISCARD_X
0975 # define Q_NODISCARD_X(message) [[nodiscard(message)]]
0976 # endif
0977 # ifndef Q_NODISCARD_CTOR_X
0978 # define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
0979 # endif
0980 #endif
0981
0982 #if __has_cpp_attribute(maybe_unused)
0983 # undef Q_DECL_UNUSED
0984 # define Q_DECL_UNUSED [[maybe_unused]]
0985 #endif
0986
0987 #if __has_cpp_attribute(noreturn)
0988 # undef Q_NORETURN
0989 # define Q_NORETURN [[noreturn]]
0990 #endif
0991
0992 #if __has_cpp_attribute(deprecated)
0993 # ifdef Q_DECL_DEPRECATED
0994 # undef Q_DECL_DEPRECATED
0995 # endif
0996 # ifdef Q_DECL_DEPRECATED_X
0997 # undef Q_DECL_DEPRECATED_X
0998 # endif
0999 # define Q_DECL_DEPRECATED [[deprecated]]
1000 # define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
1001 #endif
1002
1003 #define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
1004 #define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
1005
1006
1007
1008
1009
1010 #ifndef Q_NORETURN
1011 # define Q_NORETURN
1012 #endif
1013 #ifndef Q_LIKELY
1014 # define Q_LIKELY(x) (x)
1015 #endif
1016 #ifndef Q_UNLIKELY
1017 # define Q_UNLIKELY(x) (x)
1018 #endif
1019 #ifndef Q_ASSUME_IMPL
1020 # define Q_ASSUME_IMPL(expr) qt_noop()
1021 #endif
1022 #ifndef Q_UNREACHABLE_IMPL
1023 # define Q_UNREACHABLE_IMPL() qt_noop()
1024 #endif
1025 #ifndef Q_ALLOC_SIZE
1026 # define Q_ALLOC_SIZE(x)
1027 #endif
1028 #ifndef Q_REQUIRED_RESULT
1029 # define Q_REQUIRED_RESULT
1030 #endif
1031 #ifndef Q_NODISCARD_X
1032 # define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1033 #endif
1034 #ifndef Q_NODISCARD_CTOR
1035 # define Q_NODISCARD_CTOR
1036 #endif
1037 #ifndef Q_NODISCARD_CTOR_X
1038 # define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1039 #endif
1040 #ifndef Q_DECL_DEPRECATED
1041 # define Q_DECL_DEPRECATED
1042 #endif
1043 #ifndef Q_DECL_VARIABLE_DEPRECATED
1044 # define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
1045 #endif
1046 #ifndef Q_DECL_DEPRECATED_X
1047 # define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1048 #endif
1049 #ifndef Q_DECL_EXPORT
1050 # define Q_DECL_EXPORT
1051 #endif
1052 #ifndef Q_DECL_EXPORT_OVERRIDABLE
1053 # define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1054 #endif
1055 #ifndef Q_DECL_IMPORT
1056 # define Q_DECL_IMPORT
1057 #endif
1058 #ifndef Q_DECL_HIDDEN
1059 # define Q_DECL_HIDDEN
1060 #endif
1061 #ifndef Q_DECL_UNUSED
1062 # define Q_DECL_UNUSED
1063 #endif
1064 #ifndef Q_DECL_UNUSED_MEMBER
1065 # define Q_DECL_UNUSED_MEMBER
1066 #endif
1067 #ifndef Q_FUNC_INFO
1068 # if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1069 # define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1070 # else
1071 # define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1072 # endif
1073 #endif
1074 #ifndef Q_DECL_CF_RETURNS_RETAINED
1075 # define Q_DECL_CF_RETURNS_RETAINED
1076 #endif
1077 #ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1078 # define Q_DECL_NS_RETURNS_AUTORELEASED
1079 #endif
1080 #ifndef Q_DECL_PURE_FUNCTION
1081 # define Q_DECL_PURE_FUNCTION
1082 #endif
1083 #ifndef Q_DECL_CONST_FUNCTION
1084 # define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1085 #endif
1086 #ifndef Q_DECL_COLD_FUNCTION
1087 # define Q_DECL_COLD_FUNCTION
1088 #endif
1089 #ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1090 # define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1091 #endif
1092 #ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1093 # define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1094 #endif
1095
1096
1097
1098
1099
1100 #ifndef Q_QDOC
1101 # define Q_WEAK_OVERLOAD template <typename = void>
1102 #else
1103 # define Q_WEAK_OVERLOAD
1104 #endif
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124 #ifndef Q_QDOC
1125 # define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1126 #else
1127 # define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1128 #endif
1129
1130
1131
1132
1133
1134 #define QT_DO_PRAGMA(text) _Pragma(#text)
1135 #if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1136 # undef QT_DO_PRAGMA
1137 # define QT_WARNING_PUSH __pragma(warning(push))
1138 # define QT_WARNING_POP __pragma(warning(pop))
1139 # define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1140 # define QT_WARNING_DISABLE_INTEL(number)
1141 # define QT_WARNING_DISABLE_CLANG(text)
1142 # define QT_WARNING_DISABLE_GCC(text)
1143 # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996)
1144 # define QT_WARNING_DISABLE_FLOAT_COMPARE
1145 # define QT_WARNING_DISABLE_INVALID_OFFSETOF
1146 #elif defined(Q_CC_CLANG)
1147 # define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1148 # define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1149 # define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1150 # define QT_WARNING_DISABLE_GCC(text)
1151 # define QT_WARNING_DISABLE_INTEL(number)
1152 # define QT_WARNING_DISABLE_MSVC(number)
1153 # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
1154 # define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
1155 # define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_CLANG("-Winvalid-offsetof")
1156 #elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
1157 # define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1158 # define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1159 # define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1160 # define QT_WARNING_DISABLE_CLANG(text)
1161 # define QT_WARNING_DISABLE_INTEL(number)
1162 # define QT_WARNING_DISABLE_MSVC(number)
1163 # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1164 # define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1165 # define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1166 #else
1167 # define QT_WARNING_DISABLE_GCC(text)
1168 # define QT_WARNING_PUSH
1169 # define QT_WARNING_POP
1170 # define QT_WARNING_DISABLE_INTEL(number)
1171 # define QT_WARNING_DISABLE_MSVC(number)
1172 # define QT_WARNING_DISABLE_CLANG(text)
1173 # define QT_WARNING_DISABLE_GCC(text)
1174 # define QT_WARNING_DISABLE_DEPRECATED
1175 # define QT_WARNING_DISABLE_FLOAT_COMPARE
1176 # define QT_WARNING_DISABLE_INVALID_OFFSETOF
1177 #endif
1178
1179 #ifndef QT_IGNORE_DEPRECATIONS
1180 #define QT_IGNORE_DEPRECATIONS(statement) \
1181 QT_WARNING_PUSH \
1182 QT_WARNING_DISABLE_DEPRECATED \
1183 statement \
1184 QT_WARNING_POP
1185 #endif
1186
1187
1188 #define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
1189
1190
1191
1192
1193
1194 #define Q_OFFSETOF(Class, member) \
1195 []() -> size_t { \
1196 QT_WARNING_PUSH QT_WARNING_DISABLE_INVALID_OFFSETOF \
1197 return offsetof(Class, member); \
1198 QT_WARNING_POP \
1199 }()
1200
1201
1202
1203
1204 #ifndef QT_NO_KEYWORDS
1205 # if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1206 # define for if (0) {} else for
1207 # endif
1208 #endif
1209
1210 #ifdef Q_COMPILER_RVALUE_REFS
1211 #define qMove(x) std::move(x)
1212 #else
1213 #define qMove(x) (x)
1214 #endif
1215
1216 #if defined(__cplusplus)
1217 #if __has_cpp_attribute(clang::fallthrough)
1218 # define Q_FALLTHROUGH() [[clang::fallthrough]]
1219 #elif __has_cpp_attribute(gnu::fallthrough)
1220 # define Q_FALLTHROUGH() [[gnu::fallthrough]]
1221 #elif __has_cpp_attribute(fallthrough)
1222 # define Q_FALLTHROUGH() [[fallthrough]]
1223 #endif
1224 #endif
1225 #ifndef Q_FALLTHROUGH
1226 # ifdef Q_CC_GNU
1227 # define Q_FALLTHROUGH() __attribute__((fallthrough))
1228 # else
1229 # define Q_FALLTHROUGH() (void)0
1230 # endif
1231 #endif
1232
1233
1234
1235
1236
1237 #if !defined(Q_PROCESSOR_X86)
1238 # undef QT_COMPILER_SUPPORTS_SSE2
1239 # undef QT_COMPILER_SUPPORTS_SSE3
1240 # undef QT_COMPILER_SUPPORTS_SSSE3
1241 # undef QT_COMPILER_SUPPORTS_SSE4_1
1242 # undef QT_COMPILER_SUPPORTS_SSE4_2
1243 # undef QT_COMPILER_SUPPORTS_AVX
1244 # undef QT_COMPILER_SUPPORTS_AVX2
1245 # undef QT_COMPILER_SUPPORTS_F16C
1246 #endif
1247 #if !defined(Q_PROCESSOR_ARM)
1248 # undef QT_COMPILER_SUPPORTS_NEON
1249 #endif
1250 #if !defined(Q_PROCESSOR_MIPS)
1251 # undef QT_COMPILER_SUPPORTS_MIPS_DSP
1252 # undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1253 #endif
1254
1255
1256 #if defined(__cplusplus) && (__cplusplus < 201703L)
1257 # ifdef Q_CC_MSVC
1258 # 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."
1259 # else
1260 # error "Qt requires a C++17 compiler"
1261 # endif
1262 #endif
1263
1264 #if defined(__cplusplus) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1265 # if Q_CC_MSVC < 1927
1266
1267 # error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1268 # endif
1269
1270
1271
1272
1273
1274 static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
1275 "On MSVC you must pass the /permissive- option to the compiler.");
1276 #endif
1277
1278 #if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__)
1279
1280 #elif defined(QT_REDUCE_RELOCATIONS)
1281 # error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "\
1282 "Compile your code with -fPIC (and not with -fPIE)."
1283 #endif
1284
1285 #ifdef Q_PROCESSOR_X86_32
1286 # if defined(Q_CC_GNU)
1287 # define QT_FASTCALL __attribute__((regparm(3)))
1288 # elif defined(Q_CC_MSVC)
1289 # define QT_FASTCALL __fastcall
1290 # else
1291 # define QT_FASTCALL
1292 # endif
1293 #else
1294 # define QT_FASTCALL
1295 #endif
1296
1297
1298 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1299 # if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
1300 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
1301 __attribute__((format(gnu_printf, (A), (B))))
1302 # else
1303 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
1304 __attribute__((format(printf, (A), (B))))
1305 # endif
1306 #else
1307 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1308 #endif
1309
1310 #ifdef Q_CC_MSVC
1311 # define Q_NEVER_INLINE __declspec(noinline)
1312 # define Q_ALWAYS_INLINE __forceinline
1313 #elif defined(Q_CC_GNU)
1314 # define Q_NEVER_INLINE __attribute__((noinline))
1315 # define Q_ALWAYS_INLINE inline __attribute__((always_inline))
1316 #else
1317 # define Q_NEVER_INLINE
1318 # define Q_ALWAYS_INLINE inline
1319 #endif
1320
1321
1322
1323 #if defined(Q_OS_WIN)
1324 # if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
1325 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1326 # else
1327 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1328 # endif
1329 # define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1330 #endif
1331
1332 #ifdef __cpp_conditional_explicit
1333 #define Q_IMPLICIT explicit(false)
1334 #else
1335 #define Q_IMPLICIT
1336 #endif
1337
1338 #if defined(__cplusplus)
1339
1340 #ifdef __cpp_constinit
1341 # if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1342
1343 # define Q_CONSTINIT
1344 # else
1345 # define Q_CONSTINIT constinit
1346 # endif
1347 #elif defined(__has_cpp_attribute) && __has_cpp_attribute(clang::require_constant_initialization)
1348 # define Q_CONSTINIT [[clang::require_constant_initialization]]
1349 #elif defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1000
1350 # define Q_CONSTINIT __constinit
1351 #else
1352 # define Q_CONSTINIT
1353 #endif
1354
1355 #ifndef Q_OUTOFLINE_TEMPLATE
1356 # define Q_OUTOFLINE_TEMPLATE
1357 #endif
1358 #ifndef Q_INLINE_TEMPLATE
1359 # define Q_INLINE_TEMPLATE inline
1360 #endif
1361
1362
1363
1364
1365
1366
1367 #if !defined(QT_CC_WARNINGS)
1368 # define QT_NO_WARNINGS
1369 #endif
1370 #if defined(QT_NO_WARNINGS)
1371 # if defined(Q_CC_MSVC)
1372 QT_WARNING_DISABLE_MSVC(4251)
1373 QT_WARNING_DISABLE_MSVC(4244)
1374 QT_WARNING_DISABLE_MSVC(4275)
1375 QT_WARNING_DISABLE_MSVC(4514)
1376 QT_WARNING_DISABLE_MSVC(4800)
1377 QT_WARNING_DISABLE_MSVC(4097)
1378 QT_WARNING_DISABLE_MSVC(4706)
1379 QT_WARNING_DISABLE_MSVC(4355)
1380 QT_WARNING_DISABLE_MSVC(4710)
1381 QT_WARNING_DISABLE_MSVC(4530)
1382 # elif defined(Q_CC_BOR)
1383 # pragma option -w-inl
1384 # pragma option -w-aus
1385 # pragma warn -inl
1386 # pragma warn -pia
1387 # pragma warn -ccc
1388 # pragma warn -rch
1389 # pragma warn -sig
1390 # endif
1391 #endif
1392
1393 #if !defined(QT_NO_EXCEPTIONS)
1394 # if !defined(Q_MOC_RUN)
1395 # if defined(Q_CC_GNU) && !defined(__cpp_exceptions)
1396 # define QT_NO_EXCEPTIONS
1397 # endif
1398 # elif defined(QT_BOOTSTRAPPED)
1399 # define QT_NO_EXCEPTIONS
1400 # endif
1401 #endif
1402
1403
1404 #if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
1405 # define QT_COMPILER_HAS_LWG3346
1406 #endif
1407
1408 #if defined(__cplusplus) && __cplusplus >= 202002L
1409 # if !defined(Q_CC_MSVC_ONLY) || Q_CC_MSVC < 1939
1410
1411
1412 # define QT_COMPILER_HAS_P0846
1413 # endif
1414 #endif
1415
1416 #ifdef QT_COMPILER_HAS_P0846
1417 # define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1418 #else
1419 class QT_CLASS_JUST_FOR_P0846_SIMULATION;
1420 # define QT_ENABLE_P0846_SEMANTICS_FOR(func) \
1421 template <typename T> \
1422 void func (QT_CLASS_JUST_FOR_P0846_SIMULATION *); \
1423
1424 #endif
1425
1426 #endif
1427
1428 #endif