Warning, file /include/QtCore/qcompilerdetection.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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 # ifdef Q_CC_MSVC_ONLY
0082 # define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
0083 # endif
0084
0085 #elif defined(__BORLANDC__) || defined(__TURBOC__)
0086 # define Q_CC_BOR
0087 # define Q_INLINE_TEMPLATE
0088 # if __BORLANDC__ < 0x502
0089 # error "Compiler not supported"
0090 # endif
0091
0092 #elif defined(__WATCOMC__)
0093 # define Q_CC_WAT
0094
0095
0096
0097
0098 #elif defined(__ARMCC__) || defined(__CC_ARM)
0099 # define Q_CC_RVCT
0100
0101 # define __is_empty(X) false
0102 # define __is_pod(X) false
0103 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
0104 # ifdef Q_OS_LINUX
0105 # define Q_DECL_EXPORT __attribute__((visibility("default")))
0106 # define Q_DECL_IMPORT __attribute__((visibility("default")))
0107 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
0108 # else
0109 # define Q_DECL_EXPORT __declspec(dllexport)
0110 # define Q_DECL_IMPORT __declspec(dllimport)
0111 # endif
0112
0113 #elif defined(__GNUC__)
0114 # define Q_CC_GNU (__GNUC__ * 100 + __GNUC_MINOR__)
0115 # if defined(__MINGW32__)
0116 # define Q_CC_MINGW
0117 # endif
0118 # if defined(__clang__)
0119
0120 # if defined(__apple_build_version__)
0121
0122
0123
0124
0125
0126
0127 # if __apple_build_version__ >= 14030022
0128 # define Q_CC_CLANG 1500
0129 # elif __apple_build_version__ >= 14000029
0130 # define Q_CC_CLANG 1400
0131 # elif __apple_build_version__ >= 13160021
0132 # define Q_CC_CLANG 1300
0133 # elif __apple_build_version__ >= 13000029
0134 # define Q_CC_CLANG 1200
0135 # elif __apple_build_version__ >= 12050022
0136 # define Q_CC_CLANG 1110
0137 # elif __apple_build_version__ >= 12000032
0138 # define Q_CC_CLANG 1000
0139 # elif __apple_build_version__ >= 11030032
0140 # define Q_CC_CLANG 900
0141 # elif __apple_build_version__ >= 11000033
0142 # define Q_CC_CLANG 800
0143 # else
0144 # error "Unsupported Apple Clang version"
0145 # endif
0146 # else
0147
0148 # define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
0149 # endif
0150 # define Q_CC_CLANG_ONLY Q_CC_CLANG
0151 # if __has_builtin(__builtin_assume)
0152 # define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
0153 # else
0154 # define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
0155 # endif
0156 # define Q_UNREACHABLE_IMPL() __builtin_unreachable()
0157 # if !defined(__has_extension)
0158 #
0159 # define __has_extension __has_feature
0160 # endif
0161 # if defined(__APPLE__)
0162
0163 # define Q_DECL_CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
0164 # ifdef __OBJC__
0165 # define Q_DECL_NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased))
0166 # endif
0167 # endif
0168 # ifdef __EMSCRIPTEN__
0169 # define Q_CC_EMSCRIPTEN
0170 # endif
0171 # else
0172
0173 # define Q_CC_GNU_ONLY Q_CC_GNU
0174 # if Q_CC_GNU >= 405
0175 # define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
0176 # define Q_UNREACHABLE_IMPL() __builtin_unreachable()
0177 # define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
0178 # endif
0179 # endif
0180
0181 # ifdef Q_OS_WIN
0182 # define Q_DECL_EXPORT __declspec(dllexport)
0183 # define Q_DECL_IMPORT __declspec(dllimport)
0184 # else
0185 # define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak))
0186 # ifdef QT_USE_PROTECTED_VISIBILITY
0187 # define Q_DECL_EXPORT __attribute__((visibility("protected")))
0188 # else
0189 # define Q_DECL_EXPORT __attribute__((visibility("default")))
0190 # endif
0191 # define Q_DECL_IMPORT __attribute__((visibility("default")))
0192 # define Q_DECL_HIDDEN __attribute__((visibility("hidden")))
0193 # endif
0194
0195 # define Q_FUNC_INFO __PRETTY_FUNCTION__
0196 # define Q_TYPEOF(expr) __typeof__(expr)
0197 # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
0198 # define Q_DECL_UNUSED __attribute__((__unused__))
0199 # define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
0200 # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
0201 # define Q_NORETURN __attribute__((__noreturn__))
0202 # define Q_REQUIRED_RESULT __attribute__ ((__warn_unused_result__))
0203 # define Q_DECL_PURE_FUNCTION __attribute__((pure))
0204 # define Q_DECL_CONST_FUNCTION __attribute__((const))
0205 # define Q_DECL_COLD_FUNCTION __attribute__((cold))
0206 # define Q_PACKED __attribute__ ((__packed__))
0207 # ifndef __ARM_EABI__
0208 # define QT_NO_ARM_EABI
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_c_attribute
0444 # define __has_c_attribute(x) 0
0445 #endif
0446 #ifndef __has_cpp_attribute
0447 # define __has_cpp_attribute(x) 0
0448 #endif
0449 #ifndef __has_include
0450 # define __has_include(x) 0
0451 #endif
0452 #ifndef __has_include_next
0453 # define __has_include_next(x) 0
0454 #endif
0455
0456
0457
0458
0459
0460
0461
0462 #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
0463 # define QT_ASAN_ENABLED
0464 #endif
0465
0466
0467
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
0526 #define Q_COMPILER_THREADSAFE_STATICS
0527
0528 #if defined(Q_CC_CLANG)
0529
0530 # define Q_COMPILER_RESTRICTED_VLA
0531 # if __has_feature(attribute_deprecated_with_message)
0532 # define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
0533 # endif
0534
0535
0536
0537 # if __has_extension(cxx_binary_literals)
0538 # define Q_COMPILER_BINARY_LITERALS
0539 # endif
0540
0541
0542 # if Q_CC_CLANG >= 209
0543 # if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
0544 || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
0545 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
0546 # define Q_COMPILER_VARIADIC_MACROS
0547 # endif
0548 # endif
0549
0550
0551 # if (defined(__cplusplus) && __cplusplus >= 201103L) \
0552 || defined(__GXX_EXPERIMENTAL_CXX0X__)
0553
0554 # if __has_feature(cxx_alignas)
0555 # define Q_COMPILER_ALIGNAS
0556 # define Q_COMPILER_ALIGNOF
0557 # endif
0558 # if __has_feature(cxx_atomic) && __has_include(<atomic>)
0559 # define Q_COMPILER_ATOMICS
0560 # endif
0561 # if __has_feature(cxx_attributes)
0562 # define Q_COMPILER_ATTRIBUTES
0563 # endif
0564 # if __has_feature(cxx_auto_type)
0565 # define Q_COMPILER_AUTO_FUNCTION
0566 # define Q_COMPILER_AUTO_TYPE
0567 # endif
0568 # if __has_feature(cxx_strong_enums)
0569 # define Q_COMPILER_CLASS_ENUM
0570 # endif
0571 # if __has_feature(cxx_constexpr) && Q_CC_CLANG > 302
0572 # define Q_COMPILER_CONSTEXPR
0573 # endif
0574 # if __has_feature(cxx_decltype)
0575 # define Q_COMPILER_DECLTYPE
0576 # endif
0577 # if __has_feature(cxx_defaulted_functions)
0578 # define Q_COMPILER_DEFAULT_MEMBERS
0579 # endif
0580 # if __has_feature(cxx_deleted_functions)
0581 # define Q_COMPILER_DELETE_MEMBERS
0582 # endif
0583 # if __has_feature(cxx_delegating_constructors)
0584 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0585 # endif
0586 # if __has_feature(cxx_explicit_conversions)
0587 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0588 # endif
0589 # if __has_feature(cxx_override_control)
0590 # define Q_COMPILER_EXPLICIT_OVERRIDES
0591 # endif
0592 # if __has_feature(cxx_inheriting_constructors)
0593 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0594 # endif
0595 # if __has_feature(cxx_generalized_initializers)
0596 # define Q_COMPILER_INITIALIZER_LISTS
0597 # define Q_COMPILER_UNIFORM_INIT
0598 # endif
0599 # if __has_feature(cxx_lambdas)
0600 # define Q_COMPILER_LAMBDA
0601 # endif
0602 # if __has_feature(cxx_noexcept)
0603 # define Q_COMPILER_NOEXCEPT
0604 # endif
0605 # if __has_feature(cxx_nonstatic_member_init)
0606 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0607 # endif
0608 # if __has_feature(cxx_nullptr)
0609 # define Q_COMPILER_NULLPTR
0610 # endif
0611 # if __has_feature(cxx_range_for)
0612 # define Q_COMPILER_RANGE_FOR
0613 # endif
0614 # if __has_feature(cxx_raw_string_literals)
0615 # define Q_COMPILER_RAW_STRINGS
0616 # endif
0617 # if __has_feature(cxx_reference_qualified_functions)
0618 # define Q_COMPILER_REF_QUALIFIERS
0619 # endif
0620 # if __has_feature(cxx_rvalue_references)
0621 # define Q_COMPILER_RVALUE_REFS
0622 # endif
0623 # if __has_feature(cxx_static_assert)
0624 # define Q_COMPILER_STATIC_ASSERT
0625 # endif
0626 # if __has_feature(cxx_alias_templates)
0627 # define Q_COMPILER_TEMPLATE_ALIAS
0628 # endif
0629 # if __has_feature(cxx_thread_local)
0630 # if !defined(__FreeBSD__)
0631 # define Q_COMPILER_THREAD_LOCAL
0632 # endif
0633 # endif
0634 # if __has_feature(cxx_user_literals)
0635 # define Q_COMPILER_UDL
0636 # endif
0637 # if __has_feature(cxx_unicode_literals)
0638 # define Q_COMPILER_UNICODE_STRINGS
0639 # endif
0640 # if __has_feature(cxx_unrestricted_unions)
0641 # define Q_COMPILER_UNRESTRICTED_UNIONS
0642 # endif
0643 # if __has_feature(cxx_variadic_templates)
0644 # define Q_COMPILER_VARIADIC_TEMPLATES
0645 # endif
0646
0647 # if Q_CC_CLANG >= 209
0648 # define Q_COMPILER_EXTERN_TEMPLATES
0649 # endif
0650 # endif
0651
0652
0653 # if defined(__cplusplus) && __cplusplus > 201103L
0654
0655
0656
0657 # if __has_feature(cxx_generic_lambda)
0658 # define Q_COMPILER_GENERIC_LAMBDA
0659 # endif
0660 # if __has_feature(cxx_init_capture)
0661 # define Q_COMPILER_LAMBDA_CAPTURES
0662 # endif
0663 # if __has_feature(cxx_relaxed_constexpr)
0664 # define Q_COMPILER_RELAXED_CONSTEXPR_FUNCTIONS
0665 # endif
0666 # if __has_feature(cxx_decltype_auto) && __has_feature(cxx_return_type_deduction)
0667 # define Q_COMPILER_RETURN_TYPE_DEDUCTION
0668 # endif
0669 # if __has_feature(cxx_variable_templates)
0670 # define Q_COMPILER_VARIABLE_TEMPLATES
0671 # endif
0672 # if __has_feature(cxx_runtime_array)
0673 # define Q_COMPILER_VLA
0674 # endif
0675 # endif
0676
0677 # if defined(__STDC_VERSION__)
0678 # if __has_feature(c_static_assert)
0679 # define Q_COMPILER_STATIC_ASSERT
0680 # endif
0681 # if __has_feature(c_thread_local) && __has_include(<threads.h>)
0682 # if !defined(__FreeBSD__)
0683 # define Q_COMPILER_THREAD_LOCAL
0684 # endif
0685 # endif
0686 # endif
0687
0688 # ifndef Q_DECL_UNUSED
0689 # define Q_DECL_UNUSED __attribute__((__unused__))
0690 # endif
0691 # define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
0692 #endif
0693
0694 #if defined(Q_CC_GNU_ONLY)
0695 # define Q_COMPILER_RESTRICTED_VLA
0696 # if Q_CC_GNU >= 403
0697
0698 # define Q_COMPILER_BINARY_LITERALS
0699 # endif
0700 # if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
0701 || (defined(__cplusplus) && (__cplusplus >= 201103L)) \
0702 || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
0703
0704 # define Q_COMPILER_VARIADIC_MACROS
0705 # endif
0706 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
0707 # if Q_CC_GNU >= 403
0708
0709 # define Q_COMPILER_DECLTYPE
0710 # define Q_COMPILER_RVALUE_REFS
0711 # define Q_COMPILER_STATIC_ASSERT
0712 # endif
0713 # if Q_CC_GNU >= 404
0714
0715 # define Q_COMPILER_AUTO_FUNCTION
0716 # define Q_COMPILER_AUTO_TYPE
0717 # define Q_COMPILER_EXTERN_TEMPLATES
0718 # define Q_COMPILER_UNIFORM_INIT
0719 # define Q_COMPILER_UNICODE_STRINGS
0720 # define Q_COMPILER_VARIADIC_TEMPLATES
0721 # endif
0722 # if Q_CC_GNU >= 405
0723
0724 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0725
0726
0727 # define Q_COMPILER_INITIALIZER_LISTS
0728 # define Q_COMPILER_LAMBDA
0729 # define Q_COMPILER_RAW_STRINGS
0730 # define Q_COMPILER_CLASS_ENUM
0731 # endif
0732 # if Q_CC_GNU >= 406
0733
0734
0735
0736 # define Q_COMPILER_DEFAULT_MEMBERS
0737 # define Q_COMPILER_DELETE_MEMBERS
0738
0739 # define Q_COMPILER_NULLPTR
0740 # define Q_COMPILER_UNRESTRICTED_UNIONS
0741 # define Q_COMPILER_RANGE_FOR
0742 # endif
0743 # if Q_CC_GNU >= 407
0744
0745
0746
0747
0748 # define Q_COMPILER_ATOMICS
0749
0750
0751 # define Q_COMPILER_NOEXCEPT
0752
0753 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0754 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0755 # define Q_COMPILER_EXPLICIT_OVERRIDES
0756 # define Q_COMPILER_TEMPLATE_ALIAS
0757 # define Q_COMPILER_UDL
0758 # endif
0759 # if Q_CC_GNU >= 408
0760 # define Q_COMPILER_ATTRIBUTES
0761 # define Q_COMPILER_ALIGNAS
0762 # define Q_COMPILER_ALIGNOF
0763 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0764 # define Q_COMPILER_THREAD_LOCAL
0765 # if Q_CC_GNU > 408 || __GNUC_PATCHLEVEL__ >= 1
0766 # define Q_COMPILER_REF_QUALIFIERS
0767 # endif
0768 # endif
0769 # if Q_CC_GNU >= 500
0770
0771
0772 # define Q_COMPILER_CONSTEXPR
0773 # endif
0774 # endif
0775 # if __cplusplus > 201103L
0776 # if Q_CC_GNU >= 409
0777
0778
0779 # define Q_COMPILER_LAMBDA_CAPTURES
0780 # define Q_COMPILER_RETURN_TYPE_DEDUCTION
0781 # endif
0782 # endif
0783 # if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
0784 # if Q_CC_GNU >= 407
0785
0786 # define Q_COMPILER_STATIC_ASSERT
0787 # endif
0788 # if Q_CC_GNU >= 409 && defined(__has_include)
0789
0790 # if __has_include(<threads.h>)
0791 # define Q_COMPILER_THREAD_LOCAL
0792 # endif
0793 # endif
0794 # endif
0795 #endif
0796
0797 #if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
0798 # if defined(__cplusplus)
0799
0800 # define Q_COMPILER_VARIADIC_MACROS
0801
0802
0803
0804
0805
0806
0807
0808
0809
0810
0811
0812 # define Q_COMPILER_AUTO_FUNCTION
0813 # define Q_COMPILER_AUTO_TYPE
0814 # define Q_COMPILER_DECLTYPE
0815 # define Q_COMPILER_EXTERN_TEMPLATES
0816 # define Q_COMPILER_LAMBDA
0817 # define Q_COMPILER_NULLPTR
0818 # define Q_COMPILER_RVALUE_REFS
0819 # define Q_COMPILER_STATIC_ASSERT
0820
0821 # define Q_COMPILER_EXPLICIT_OVERRIDES
0822 # define Q_COMPILER_CLASS_ENUM
0823 # define Q_COMPILER_ATOMICS
0824
0825 # define Q_COMPILER_DELETE_MEMBERS
0826 # define Q_COMPILER_DELEGATING_CONSTRUCTORS
0827 # define Q_COMPILER_EXPLICIT_CONVERSIONS
0828 # define Q_COMPILER_NONSTATIC_MEMBER_INIT
0829 # define Q_COMPILER_RAW_STRINGS
0830 # define Q_COMPILER_TEMPLATE_ALIAS
0831 # define Q_COMPILER_VARIADIC_TEMPLATES
0832 # define Q_COMPILER_INITIALIZER_LISTS
0833
0834 # define Q_COMPILER_DEFAULT_MEMBERS
0835 # define Q_COMPILER_ALIGNAS
0836 # define Q_COMPILER_ALIGNOF
0837 # define Q_COMPILER_INHERITING_CONSTRUCTORS
0838 # define Q_COMPILER_NOEXCEPT
0839 # define Q_COMPILER_RANGE_FOR
0840 # define Q_COMPILER_REF_QUALIFIERS
0841 # define Q_COMPILER_THREAD_LOCAL
0842 # define Q_COMPILER_UDL
0843 # define Q_COMPILER_UNICODE_STRINGS
0844 # define Q_COMPILER_UNRESTRICTED_UNIONS
0845 # if _MSC_FULL_VER >= 190023419
0846 # define Q_COMPILER_ATTRIBUTES
0847
0848
0849 # define Q_COMPILER_UNIFORM_INIT
0850 # endif
0851 # if _MSC_VER >= 1910
0852 # define Q_COMPILER_CONSTEXPR
0853 # endif
0854
0855
0856
0857
0858 # if _MSC_VER < 1936
0859 # define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
0860 # endif
0861
0862 # define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
0863 # endif
0864 #endif
0865
0866 #ifdef Q_COMPILER_UNICODE_STRINGS
0867 # define Q_STDLIB_UNICODE_STRINGS
0868 #elif defined(__cplusplus)
0869 # error "Qt6 requires Unicode string support in both the compiler and the standard library"
0870 #endif
0871
0872 #ifdef __cplusplus
0873 # include <utility>
0874 # if defined(Q_OS_QNX)
0875
0876
0877
0878
0879
0880
0881
0882
0883 # if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
0884
0885
0886
0887
0888
0889 # if !defined(_HAS_CPP0X) || !_HAS_CPP0X
0890
0891 # undef Q_COMPILER_INITIALIZER_LISTS
0892 # undef Q_COMPILER_RVALUE_REFS
0893 # undef Q_COMPILER_REF_QUALIFIERS
0894 # undef Q_COMPILER_NOEXCEPT
0895
0896 # undef Q_STDLIB_UNICODE_STRINGS
0897 # endif
0898 # if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
0899 # undef Q_COMPILER_NULLPTR
0900 # endif
0901 # if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
0902
0903
0904 # undef Q_COMPILER_CONSTEXPR
0905 # endif
0906 # endif
0907 # endif
0908 # if defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
0909 # if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
0910
0911
0912 # undef Q_COMPILER_INITIALIZER_LISTS
0913 # undef Q_COMPILER_RVALUE_REFS
0914 # undef Q_COMPILER_REF_QUALIFIERS
0915
0916 # undef Q_COMPILER_ATOMICS
0917 # endif
0918 # if defined(__cpp_lib_memory_resource) \
0919 && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \
0920 || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000))
0921 # undef __cpp_lib_memory_resource
0922 # endif
0923 # endif
0924 #endif
0925
0926
0927 #if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
0928 # define Q_COMPILER_DEFAULT_DELETE_MEMBERS
0929 #endif
0930
0931
0932
0933
0934
0935 #define Q_ALIGNOF(x) alignof(x)
0936 #define Q_DECL_ALIGN(n) alignas(n)
0937 #define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
0938 #ifdef __cplusplus
0939 # define Q_CONSTEXPR constexpr
0940 # define Q_DECL_CONSTEXPR constexpr
0941 # define Q_DECL_EQ_DEFAULT = default
0942 # define Q_DECL_EQ_DELETE = delete
0943 # define Q_DECL_FINAL final
0944 # define Q_DECL_NOEXCEPT noexcept
0945 # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
0946 # define Q_DECL_OVERRIDE override
0947 # define Q_DECL_RELAXED_CONSTEXPR constexpr
0948 # define Q_NULLPTR nullptr
0949 # define Q_RELAXED_CONSTEXPR constexpr
0950 #else
0951 # define Q_CONSTEXPR const
0952 # define Q_DECL_CONSTEXPR
0953 # define Q_DECL_RELAXED_CONSTEXPR
0954 # define Q_NULLPTR NULL
0955 # define Q_RELAXED_CONSTEXPR const
0956 # ifdef Q_CC_GNU
0957 # define Q_DECL_NOEXCEPT __attribute__((__nothrow__))
0958 # else
0959 # define Q_DECL_NOEXCEPT
0960 # endif
0961 #endif
0962
0963 #if (defined(__cplusplus) && __has_cpp_attribute(nodiscard) ) || \
0964 (!defined(__cplusplus) && __has_c_attribute(nodiscard) )
0965 # undef Q_REQUIRED_RESULT
0966 # define Q_REQUIRED_RESULT [[nodiscard]]
0967 #endif
0968
0969 #if (defined(__cplusplus) && __has_cpp_attribute(nodiscard) >= 201907L ) \
0970 || (!defined(__cplusplus) && __has_c_attribute(nodiscard) )
0971
0972 # ifndef Q_NODISCARD_CTOR
0973 # define Q_NODISCARD_CTOR [[nodiscard]]
0974 # endif
0975
0976 # ifndef Q_NODISCARD_X
0977 # define Q_NODISCARD_X(message) [[nodiscard(message)]]
0978 # endif
0979 # ifndef Q_NODISCARD_CTOR_X
0980 # define Q_NODISCARD_CTOR_X(message) [[nodiscard(message)]]
0981 # endif
0982 #endif
0983
0984 #if (defined(__cplusplus) && __has_cpp_attribute(maybe_unused)) || \
0985 (!defined(__cplusplus) && __has_c_attribute(maybe_unused))
0986 # undef Q_DECL_UNUSED
0987 # define Q_DECL_UNUSED [[maybe_unused]]
0988 #endif
0989
0990 #if (defined(__cplusplus) && __has_cpp_attribute(noreturn)) || \
0991 (!defined(__cplusplus) && __has_c_attribute(noreturn))
0992 # undef Q_NORETURN
0993 # define Q_NORETURN [[noreturn]]
0994 #endif
0995
0996 #if (defined(__cplusplus) && __has_cpp_attribute(deprecated)) || \
0997 (!defined(__cplusplus) && __has_c_attribute(deprecated))
0998 # ifdef Q_DECL_DEPRECATED
0999 # undef Q_DECL_DEPRECATED
1000 # endif
1001 # ifdef Q_DECL_DEPRECATED_X
1002 # undef Q_DECL_DEPRECATED_X
1003 # endif
1004 # define Q_DECL_DEPRECATED [[deprecated]]
1005 # define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
1006 #endif
1007
1008 #define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
1009 #define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
1010
1011 #ifndef Q_DECL_CONSTEXPR_DTOR
1012 # if __cpp_constexpr >= 201907L
1013 # define Q_DECL_CONSTEXPR_DTOR constexpr
1014 # else
1015 # define Q_DECL_CONSTEXPR_DTOR inline
1016 # endif
1017 #endif
1018
1019 #ifndef Q_CONSTEXPR_DTOR
1020 # if __cpp_constexpr >= 201907L
1021 # define Q_CONSTEXPR_DTOR constexpr
1022 # else
1023 # define Q_CONSTEXPR_DTOR const
1024 # endif
1025 #endif
1026
1027 #ifndef Q_DECL_EQ_DELETE_X
1028
1029
1030
1031 # if defined(__cpp_deleted_function) && __cpp_deleted_function >= 202403L \
1032 && (!defined(Q_CC_CLANG_ONLY) || Q_CC_CLANG_ONLY >= 2000 || __cplusplus > 202302L)
1033 # define Q_DECL_EQ_DELETE_X(reason) = delete(reason)
1034 # else
1035 # define Q_DECL_EQ_DELETE_X(reason) = delete
1036 # endif
1037 #endif
1038
1039 #ifndef Q_LIKELY_BRANCH
1040 # if __has_cpp_attribute(likely)
1041 # define Q_LIKELY_BRANCH [[likely]]
1042 # define Q_UNLIKELY_BRANCH [[unlikely]]
1043 # else
1044 # define Q_LIKELY_BRANCH
1045 # define Q_UNLIKELY_BRANCH
1046 # endif
1047 #endif
1048
1049
1050
1051
1052
1053 #ifndef Q_NORETURN
1054 # define Q_NORETURN
1055 #endif
1056 #ifndef Q_LIKELY
1057 # define Q_LIKELY(x) (x)
1058 #endif
1059 #ifndef Q_UNLIKELY
1060 # define Q_UNLIKELY(x) (x)
1061 #endif
1062 #ifndef Q_ASSUME_IMPL
1063 # define Q_ASSUME_IMPL(expr) qt_noop()
1064 #endif
1065 #ifndef Q_UNREACHABLE_IMPL
1066 # define Q_UNREACHABLE_IMPL() qt_noop()
1067 #endif
1068 #ifndef Q_ALLOC_SIZE
1069 # define Q_ALLOC_SIZE(x)
1070 #endif
1071 #ifndef Q_REQUIRED_RESULT
1072 # define Q_REQUIRED_RESULT
1073 #endif
1074 #ifndef Q_NODISCARD_X
1075 # define Q_NODISCARD_X(message) Q_REQUIRED_RESULT
1076 #endif
1077 #ifndef Q_NODISCARD_CTOR
1078 # define Q_NODISCARD_CTOR
1079 #endif
1080 #ifndef Q_NODISCARD_CTOR_X
1081 # define Q_NODISCARD_CTOR_X(message) Q_NODISCARD_CTOR
1082 #endif
1083 #ifndef Q_DECL_DEPRECATED
1084 # define Q_DECL_DEPRECATED
1085 #endif
1086 #ifndef Q_DECL_VARIABLE_DEPRECATED
1087 # define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
1088 #endif
1089 #ifndef Q_DECL_DEPRECATED_X
1090 # define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
1091 #endif
1092 #ifndef Q_DECL_EXPORT
1093 # define Q_DECL_EXPORT
1094 #endif
1095 #ifndef Q_DECL_EXPORT_OVERRIDABLE
1096 # define Q_DECL_EXPORT_OVERRIDABLE Q_DECL_EXPORT
1097 #endif
1098 #ifndef Q_DECL_IMPORT
1099 # define Q_DECL_IMPORT
1100 #endif
1101 #ifndef Q_DECL_HIDDEN
1102 # define Q_DECL_HIDDEN
1103 #endif
1104 #ifndef Q_DECL_UNUSED
1105 # define Q_DECL_UNUSED
1106 #endif
1107 #ifndef Q_DECL_UNUSED_MEMBER
1108 # define Q_DECL_UNUSED_MEMBER
1109 #endif
1110 #ifndef Q_FUNC_INFO
1111 # if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC)
1112 # define Q_FUNC_INFO __FILE__ "(line number unavailable)"
1113 # else
1114 # define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__)
1115 # endif
1116 #endif
1117 #ifndef Q_DECL_CF_RETURNS_RETAINED
1118 # define Q_DECL_CF_RETURNS_RETAINED
1119 #endif
1120 #ifndef Q_DECL_NS_RETURNS_AUTORELEASED
1121 # define Q_DECL_NS_RETURNS_AUTORELEASED
1122 #endif
1123 #ifndef Q_DECL_PURE_FUNCTION
1124 # define Q_DECL_PURE_FUNCTION
1125 #endif
1126 #ifndef Q_DECL_CONST_FUNCTION
1127 # define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
1128 #endif
1129 #ifndef Q_DECL_COLD_FUNCTION
1130 # define Q_DECL_COLD_FUNCTION
1131 #endif
1132 #ifndef QT_MAKE_UNCHECKED_ARRAY_ITERATOR
1133 # define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) (x)
1134 #endif
1135 #ifndef QT_MAKE_CHECKED_ARRAY_ITERATOR
1136 # define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) (x)
1137 #endif
1138
1139
1140
1141
1142
1143 #ifndef Q_QDOC
1144 # define Q_WEAK_OVERLOAD template <typename = void>
1145 #else
1146 # define Q_WEAK_OVERLOAD
1147 #endif
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167 #ifndef Q_QDOC
1168 # define QT_POST_CXX17_API_IN_EXPORTED_CLASS template <typename = void>
1169 #else
1170 # define QT_POST_CXX17_API_IN_EXPORTED_CLASS
1171 #endif
1172
1173
1174
1175
1176
1177 #define QT_DO_PRAGMA(text) _Pragma(#text)
1178 #if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1179 # undef QT_DO_PRAGMA
1180 # define QT_WARNING_PUSH __pragma(warning(push))
1181 # define QT_WARNING_POP __pragma(warning(pop))
1182 # define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
1183 # define QT_WARNING_DISABLE_INTEL(number)
1184 # define QT_WARNING_DISABLE_CLANG(text)
1185 # define QT_WARNING_DISABLE_GCC(text)
1186 # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996)
1187 # define QT_WARNING_DISABLE_FLOAT_COMPARE
1188 # define QT_WARNING_DISABLE_INVALID_OFFSETOF
1189 #elif defined(Q_CC_CLANG)
1190 # define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
1191 # define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
1192 # define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
1193 # define QT_WARNING_DISABLE_GCC(text)
1194 # define QT_WARNING_DISABLE_INTEL(number)
1195 # define QT_WARNING_DISABLE_MSVC(number)
1196 # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
1197 # define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
1198 # define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_CLANG("-Winvalid-offsetof")
1199 #elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
1200 # define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
1201 # define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
1202 # define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
1203 # define QT_WARNING_DISABLE_CLANG(text)
1204 # define QT_WARNING_DISABLE_INTEL(number)
1205 # define QT_WARNING_DISABLE_MSVC(number)
1206 # define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
1207 # define QT_WARNING_DISABLE_FLOAT_COMPARE QT_WARNING_DISABLE_GCC("-Wfloat-equal")
1208 # define QT_WARNING_DISABLE_INVALID_OFFSETOF QT_WARNING_DISABLE_GCC("-Winvalid-offsetof")
1209 #else
1210 # define QT_WARNING_DISABLE_GCC(text)
1211 # define QT_WARNING_PUSH
1212 # define QT_WARNING_POP
1213 # define QT_WARNING_DISABLE_INTEL(number)
1214 # define QT_WARNING_DISABLE_MSVC(number)
1215 # define QT_WARNING_DISABLE_CLANG(text)
1216 # define QT_WARNING_DISABLE_GCC(text)
1217 # define QT_WARNING_DISABLE_DEPRECATED
1218 # define QT_WARNING_DISABLE_FLOAT_COMPARE
1219 # define QT_WARNING_DISABLE_INVALID_OFFSETOF
1220 #endif
1221
1222 #ifndef QT_IGNORE_DEPRECATIONS
1223 #define QT_IGNORE_DEPRECATIONS(statement) \
1224 QT_WARNING_PUSH \
1225 QT_WARNING_DISABLE_DEPRECATED \
1226 statement \
1227 QT_WARNING_POP
1228 #endif
1229
1230
1231 #define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
1232
1233
1234
1235
1236
1237 #define Q_OFFSETOF(Class, member) \
1238 []() -> size_t { \
1239 QT_WARNING_PUSH QT_WARNING_DISABLE_INVALID_OFFSETOF \
1240 return offsetof(Class, member); \
1241 QT_WARNING_POP \
1242 }()
1243
1244
1245
1246
1247 #ifndef QT_NO_KEYWORDS
1248 # if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64))
1249 # define for if (0) {} else for
1250 # endif
1251 #endif
1252
1253 #ifdef Q_COMPILER_RVALUE_REFS
1254 #define qMove(x) std::move(x)
1255 #else
1256 #define qMove(x) (x)
1257 #endif
1258
1259 #if defined(__cplusplus)
1260 #if __has_cpp_attribute(clang::fallthrough)
1261 # define Q_FALLTHROUGH() [[clang::fallthrough]]
1262 #elif __has_cpp_attribute(gnu::fallthrough)
1263 # define Q_FALLTHROUGH() [[gnu::fallthrough]]
1264 #elif __has_cpp_attribute(fallthrough)
1265 # define Q_FALLTHROUGH() [[fallthrough]]
1266 #endif
1267 #else
1268 # if __has_c_attribute(fallthrough)
1269 # define Q_FALLTHROUGH() [[fallthrough]]
1270 # endif
1271 #endif
1272 #ifndef Q_FALLTHROUGH
1273 # ifdef Q_CC_GNU
1274 # define Q_FALLTHROUGH() __attribute__((fallthrough))
1275 # else
1276 # define Q_FALLTHROUGH() (void)0
1277 # endif
1278 #endif
1279
1280 #if defined(__has_attribute) && __has_attribute(uninitialized)
1281 # define Q_DECL_UNINITIALIZED __attribute__((uninitialized))
1282 #else
1283 # define Q_DECL_UNINITIALIZED
1284 #endif
1285
1286
1287
1288
1289
1290 #if !defined(Q_PROCESSOR_X86)
1291 # undef QT_COMPILER_SUPPORTS_SSE2
1292 # undef QT_COMPILER_SUPPORTS_SSE3
1293 # undef QT_COMPILER_SUPPORTS_SSSE3
1294 # undef QT_COMPILER_SUPPORTS_SSE4_1
1295 # undef QT_COMPILER_SUPPORTS_SSE4_2
1296 # undef QT_COMPILER_SUPPORTS_AVX
1297 # undef QT_COMPILER_SUPPORTS_AVX2
1298 # undef QT_COMPILER_SUPPORTS_F16C
1299 #endif
1300 #if !defined(Q_PROCESSOR_ARM)
1301 # undef QT_COMPILER_SUPPORTS_NEON
1302 #endif
1303 #if !defined(Q_PROCESSOR_MIPS)
1304 # undef QT_COMPILER_SUPPORTS_MIPS_DSP
1305 # undef QT_COMPILER_SUPPORTS_MIPS_DSPR2
1306 #endif
1307
1308
1309 #if defined(__cplusplus) && (__cplusplus < 201703L)
1310 # ifdef Q_CC_MSVC
1311 # 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."
1312 # else
1313 # error "Qt requires a C++17 compiler"
1314 # endif
1315 #endif
1316
1317 #if defined(__cplusplus) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1318 # if Q_CC_MSVC < 1927
1319
1320 # error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1321 # endif
1322
1323
1324
1325
1326
1327 static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
1328 "On MSVC you must pass the /permissive- option to the compiler.");
1329 #endif
1330
1331 #if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__)
1332
1333 #elif defined(__PIE__)
1334 # error "-fPIE is not sufficient if Qt was configured with the -DFEATURE_reduce_relocations=ON "\
1335 "CMake option. Compile your code with -fPIC and without -fPIE or compile Qt with "\
1336 "-DFEATURE_no_direct_extern_access=ON."
1337 #elif defined(QT_REDUCE_RELOCATIONS)
1338 # error "You must build your code with position independent code if Qt was configured with the "\
1339 "-DFEATURE_reduce_relocations=ON CMake option. Compile your code with -fPIC and "\
1340 "without -fPIE or compile Qt with -DFEATURE_no_direct_extern_access=ON."
1341 #endif
1342
1343 #ifdef Q_PROCESSOR_X86_32
1344 # if defined(Q_CC_GNU)
1345 # define QT_FASTCALL __attribute__((regparm(3)))
1346 # elif defined(Q_CC_MSVC)
1347 # define QT_FASTCALL __fastcall
1348 # else
1349 # define QT_FASTCALL
1350 # endif
1351 #else
1352 # define QT_FASTCALL
1353 #endif
1354
1355
1356 #if defined(Q_CC_GNU) && !defined(__INSURE__)
1357 # if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
1358 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
1359 __attribute__((format(gnu_printf, (A), (B))))
1360 # else
1361 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \
1362 __attribute__((format(printf, (A), (B))))
1363 # endif
1364 #else
1365 # define Q_ATTRIBUTE_FORMAT_PRINTF(A, B)
1366 #endif
1367
1368 #ifdef Q_CC_MSVC
1369 # define Q_NEVER_INLINE __declspec(noinline)
1370 # define Q_ALWAYS_INLINE __forceinline
1371 #elif defined(Q_CC_GNU)
1372 # define Q_NEVER_INLINE __attribute__((noinline))
1373 # define Q_ALWAYS_INLINE inline __attribute__((always_inline))
1374 #else
1375 # define Q_NEVER_INLINE
1376 # define Q_ALWAYS_INLINE inline
1377 #endif
1378
1379
1380
1381 #if defined(Q_OS_WIN)
1382 # if defined(Q_CC_MINGW) && defined(Q_PROCESSOR_X86_32)
1383 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE __attribute__ ((force_align_arg_pointer))
1384 # else
1385 # define QT_ENSURE_STACK_ALIGNED_FOR_SSE
1386 # endif
1387 # define QT_WIN_CALLBACK CALLBACK QT_ENSURE_STACK_ALIGNED_FOR_SSE
1388 #endif
1389
1390 #ifdef __cpp_conditional_explicit
1391 #define Q_IMPLICIT explicit(false)
1392 #else
1393 #define Q_IMPLICIT
1394 #endif
1395
1396 #if defined(__cplusplus)
1397
1398 #ifdef __cpp_constinit
1399 # if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1400
1401 # define Q_CONSTINIT
1402 # else
1403 # define Q_CONSTINIT constinit
1404 # endif
1405 #elif defined(__has_cpp_attribute) && __has_cpp_attribute(clang::require_constant_initialization)
1406 # define Q_CONSTINIT [[clang::require_constant_initialization]]
1407 #elif defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1000
1408 # define Q_CONSTINIT __constinit
1409 #else
1410 # define Q_CONSTINIT
1411 #endif
1412
1413 #ifndef Q_OUTOFLINE_TEMPLATE
1414 # define Q_OUTOFLINE_TEMPLATE
1415 #endif
1416 #ifndef Q_INLINE_TEMPLATE
1417 # define Q_INLINE_TEMPLATE inline
1418 #endif
1419
1420
1421
1422
1423
1424
1425 #if !defined(QT_CC_WARNINGS)
1426 # define QT_NO_WARNINGS
1427 #endif
1428 #if defined(QT_NO_WARNINGS)
1429 # if defined(Q_CC_MSVC)
1430 QT_WARNING_DISABLE_MSVC(4251)
1431 QT_WARNING_DISABLE_MSVC(4244)
1432 QT_WARNING_DISABLE_MSVC(4275)
1433 QT_WARNING_DISABLE_MSVC(4514)
1434 QT_WARNING_DISABLE_MSVC(4800)
1435 QT_WARNING_DISABLE_MSVC(4097)
1436 QT_WARNING_DISABLE_MSVC(4706)
1437 QT_WARNING_DISABLE_MSVC(4355)
1438 QT_WARNING_DISABLE_MSVC(4710)
1439 QT_WARNING_DISABLE_MSVC(4530)
1440 # elif defined(Q_CC_BOR)
1441 # pragma option -w-inl
1442 # pragma option -w-aus
1443 # pragma warn -inl
1444 # pragma warn -pia
1445 # pragma warn -ccc
1446 # pragma warn -rch
1447 # pragma warn -sig
1448 # endif
1449 #endif
1450
1451 #if !defined(QT_NO_EXCEPTIONS)
1452 # if !defined(Q_MOC_RUN)
1453 # if defined(Q_CC_GNU) && !defined(__cpp_exceptions)
1454 # define QT_NO_EXCEPTIONS
1455 # endif
1456 # elif defined(QT_BOOTSTRAPPED)
1457 # define QT_NO_EXCEPTIONS
1458 # endif
1459 #endif
1460
1461
1462 #if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
1463 # define QT_COMPILER_HAS_LWG3346
1464 #endif
1465
1466 #if defined(__cplusplus) && __cplusplus >= 202002L
1467 # if !defined(Q_CC_MSVC_ONLY) || Q_CC_MSVC >= 1939
1468
1469
1470 # define QT_COMPILER_HAS_P0846
1471 # endif
1472 #endif
1473
1474 #ifdef QT_COMPILER_HAS_P0846
1475 # define QT_ENABLE_P0846_SEMANTICS_FOR(func)
1476 #else
1477 class QT_CLASS_JUST_FOR_P0846_SIMULATION;
1478 # define QT_ENABLE_P0846_SEMANTICS_FOR(func) \
1479 template <typename T> \
1480 void func (QT_CLASS_JUST_FOR_P0846_SIMULATION *); \
1481
1482 #endif
1483
1484 #endif
1485
1486 #endif