Back to home page

EIC code displayed by LXR

 
 

    


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 // Copyright (C) 2022 The Qt Company Ltd.
0002 // Copyright (C) 2016 Intel Corporation.
0003 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
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    The compiler, must be one of: (Q_CC_x)
0020 
0021      COVERITY - Coverity cov-scan
0022      SYM      - Digital Mars C/C++ (used to be Symantec C++)
0023      MSVC     - Microsoft Visual C/C++, Intel C++ for Windows
0024      BOR      - Borland/Turbo C++
0025      WAT      - Watcom C++
0026      GNU      - GNU C++
0027      COMEAU   - Comeau C++
0028      EDG      - Edison Design Group C++
0029      OC       - CenterLine C++
0030      SUN      - Forte Developer, or Sun Studio C++
0031      MIPS     - MIPSpro C++
0032      DEC      - DEC C++
0033      HPACC    - HP aC++
0034      USLC     - SCO OUDK and UDK
0035      CDS      - Reliant C++
0036      KAI      - KAI C++
0037      INTEL    - Intel C++ for Linux, Intel C++ for Windows
0038      HIGHC    - MetaWare High C/C++
0039      PGI      - Portland Group C++
0040      GHS      - Green Hills Optimizing C++ Compilers
0041      RVCT     - ARM Realview Compiler Suite
0042      CLANG    - C++ front-end for the LLVM compiler
0043 
0044 
0045    Should be sorted most to least authoritative.
0046 */
0047 
0048 #if defined(__COVERITY__)
0049 #  define Q_CC_COVERITY
0050 #  define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
0051 #endif
0052 
0053 /* Symantec C++ is now Digital Mars */
0054 #if defined(__DMC__) || defined(__SC__)
0055 #  define Q_CC_SYM
0056 /* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
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 // stdext is deprecated since VS 2022 17.8
0079 #    define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500
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 /* ARM Realview Compiler Suite
0096    RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given),
0097    so check for it before that */
0098 #elif defined(__ARMCC__) || defined(__CC_ARM)
0099 #  define Q_CC_RVCT
0100 /* work-around for missing compiler intrinsics */
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 /* Clang also masquerades as GCC */
0120 #    if defined(__apple_build_version__)
0121       // The Clang version reported by Apple Clang in __clang_major__
0122       // and __clang_minor__ does _not_ reflect the actual upstream
0123       // version of the compiler. To allow consumers to use a single
0124       // define to verify the Clang version we hard-code the versions
0125       // based on the best available info we have about the actual
0126       // version: http://en.wikipedia.org/wiki/Xcode#Toolchain_Versions
0127 #      if __apple_build_version__   >= 14030022 // Xcode 14.3
0128 #        define Q_CC_CLANG 1500
0129 #      elif __apple_build_version__ >= 14000029 // Xcode 14.0
0130 #        define Q_CC_CLANG 1400
0131 #      elif __apple_build_version__ >= 13160021 // Xcode 13.3
0132 #        define Q_CC_CLANG 1300
0133 #      elif __apple_build_version__ >= 13000029 // Xcode 13.0
0134 #        define Q_CC_CLANG 1200
0135 #      elif __apple_build_version__ >= 12050022 // Xcode 12.5
0136 #        define Q_CC_CLANG 1110
0137 #      elif __apple_build_version__ >= 12000032 // Xcode 12.0
0138 #        define Q_CC_CLANG 1000
0139 #      elif __apple_build_version__ >= 11030032 // Xcode 11.4
0140 #        define Q_CC_CLANG 900
0141 #      elif __apple_build_version__ >= 11000033 // Xcode 11.0
0142 #        define Q_CC_CLANG 800
0143 #      else
0144 #        error "Unsupported Apple Clang version"
0145 #      endif
0146 #    else
0147        // Non-Apple Clang, so we trust the versions reported
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 #      /* Compatibility with older Clang versions */
0159 #      define __has_extension __has_feature
0160 #    endif
0161 #    if defined(__APPLE__)
0162      /* Apple/clang specific features */
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 /* Plain GCC */
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 /* IBM compiler versions are a bit messy. There are actually two products:
0215    the C product, and the C++ product. The C++ compiler is always packaged
0216    with the latest version of the C compiler. Version numbers do not always
0217    match. This little table (I'm not sure it's accurate) should be helpful:
0218 
0219    C++ product                C product
0220 
0221    C Set 3.1                  C Compiler 3.0
0222    ...                        ...
0223    C++ Compiler 3.6.6         C Compiler 4.3
0224    ...                        ...
0225    Visual Age C++ 4.0         ...
0226    ...                        ...
0227    Visual Age C++ 5.0         C Compiler 5.0
0228    ...                        ...
0229    Visual Age C++ 6.0         C Compiler 6.0
0230 
0231    Now:
0232    __xlC__    is the version of the C compiler in hexadecimal notation
0233               is only an approximation of the C++ compiler version
0234    __IBMCPP__ is the version of the C++ compiler in decimal notation
0235               but it is not defined on older compilers like C Set 3.1 */
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 /* Older versions of DEC C++ do not define __EDG__ or __EDG - observed
0246    on DEC C++ V5.5-004. New versions do define  __EDG__ - observed on
0247    Compaq C++ V6.3-002.
0248    This compiler is different enough from other EDG compilers to handle
0249    it separately anyway. */
0250 #elif defined(__DECCXX) || defined(__DECC)
0251 #  define Q_CC_DEC
0252 /* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
0253    DEC C++ V5 compilers. */
0254 #  if defined(__EDG__)
0255 #    define Q_CC_EDG
0256 #  endif
0257 /* Compaq has disabled EDG's _BOOL macro and uses _BOOL_EXISTS instead
0258    - observed on Compaq C++ V6.3-002.
0259    In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
0260 #  if !defined(_BOOL_EXISTS)
0261 #    error "Compiler not supported"
0262 #  endif
0263 /* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
0264 /* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
0265    DEC C++ V5.5-004. */
0266 #  if __DECCXX_VER < 60060000
0267 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
0268 #  endif
0269 /* avoid undefined symbol problems with out-of-line template members */
0270 #  define Q_OUTOFLINE_TEMPLATE inline
0271 
0272 /* The Portland Group C++ compiler is based on EDG and does define __EDG__
0273    but the C compiler does not */
0274 #elif defined(__PGI)
0275 #  define Q_CC_PGI
0276 #  if defined(__EDG__)
0277 #    define Q_CC_EDG
0278 #  endif
0279 
0280 /* Compilers with EDG front end are similar. To detect them we test:
0281    __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
0282    __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002
0283    and PGI C++ 5.2-4 */
0284 #elif !defined(Q_OS_HPUX) && (defined(__EDG) || defined(__EDG__))
0285 #  define Q_CC_EDG
0286 /* From the EDG documentation (does not seem to apply to Compaq C++ or GHS C):
0287    _BOOL
0288         Defined in C++ mode when bool is a keyword. The name of this
0289         predefined macro is specified by a configuration flag. _BOOL
0290         is the default.
0291    __BOOL_DEFINED
0292         Defined in Microsoft C++ mode when bool is a keyword. */
0293 #  if !defined(_BOOL) && !defined(__BOOL_DEFINED) && !defined(__ghs)
0294 #    error "Compiler not supported"
0295 #  endif
0296 
0297 /* The Comeau compiler is based on EDG and does define __EDG__ */
0298 #  if defined(__COMO__)
0299 #    define Q_CC_COMEAU
0300 
0301 /* The `using' keyword was introduced to avoid KAI C++ warnings
0302    but it's now causing KAI C++ errors instead. The standard is
0303    unclear about the use of this keyword, and in practice every
0304    compiler is using its own set of rules. Forget it. */
0305 #  elif defined(__KCC)
0306 #    define Q_CC_KAI
0307 
0308 /* Uses CFront, make sure to read the manual how to tweak templates. */
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 //__cplusplus
0355 
0356 #  elif defined(__DCC__)
0357 #    define Q_CC_DIAB
0358 #    if !defined(__bool)
0359 #      error "Compiler not supported"
0360 #    endif
0361 
0362 /* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
0363 #  elif defined(__USLC__) && defined(__SCO_VERSION__)
0364 #    define Q_CC_USLC
0365 /* The latest UDK 7.1.1b does not need this, but previous versions do */
0366 #    if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
0367 #      define Q_OUTOFLINE_TEMPLATE inline
0368 #    endif
0369 
0370 /* Never tested! */
0371 #  elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
0372 #    define Q_CC_OC
0373 
0374 /* CDS++ defines __EDG__ although this is not documented in the Reliant
0375    documentation. It also follows conventions like _BOOL and this documented */
0376 #  elif defined(sinix)
0377 #    define Q_CC_CDS
0378 #  endif
0379 
0380 /* VxWorks' DIAB toolchain has an additional EDG type C++ compiler
0381    (see __DCC__ above). This one is for C mode files (__EDG is not defined) */
0382 #elif defined(_DIAB_TOOL)
0383 #  define Q_CC_DIAB
0384 #  define Q_FUNC_INFO       __PRETTY_FUNCTION__
0385 
0386 /* Never tested! */
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 /* 5.0 compiler or better
0394     'bool' is enabled by default but can be disabled using -features=nobool
0395     in which case _BOOL is not defined
0396         this is the default in 4.2 compatibility mode triggered by -compat=4 */
0397 #  if __SUNPRO_CC >= 0x500
0398 #    define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS
0399    /* see http://developers.sun.com/sunstudio/support/Ccompare.html */
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 /* 4.2 compiler or older */
0410 #  else
0411 #    error "Compiler not supported"
0412 #  endif
0413 
0414 /* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
0415    documentation but nevertheless uses EDG conventions like _BOOL */
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  * SG10's SD-6 feature detection and some useful extensions from Clang and GCC
0430  * https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
0431  * http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros
0432  * Not using wrapper macros, per http://eel.is/c++draft/cpp.cond#7.sentence-2
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    detecting ASAN can be helpful to disable slow tests
0458    clang uses feature, gcc  defines __SANITIZE_ADDRESS__
0459    unconditionally check both in case other compilers mirror
0460    either of those options
0461  */
0462 #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
0463 #  define QT_ASAN_ENABLED
0464 #endif
0465 
0466 /*
0467  * C++11 support
0468  *
0469  *  Paper           Macro                               SD-6 macro
0470  *  N2341           Q_COMPILER_ALIGNAS
0471  *  N2341           Q_COMPILER_ALIGNOF
0472  *  N2427           Q_COMPILER_ATOMICS
0473  *  N2761           Q_COMPILER_ATTRIBUTES               __cpp_attributes = 200809
0474  *  N2541           Q_COMPILER_AUTO_FUNCTION
0475  *  N1984 N2546     Q_COMPILER_AUTO_TYPE
0476  *  N2437           Q_COMPILER_CLASS_ENUM
0477  *  N2235           Q_COMPILER_CONSTEXPR                __cpp_constexpr = 200704
0478  *  N2343 N3276     Q_COMPILER_DECLTYPE                 __cpp_decltype = 200707
0479  *  N2346           Q_COMPILER_DEFAULT_MEMBERS
0480  *  N2346           Q_COMPILER_DELETE_MEMBERS
0481  *  N1986           Q_COMPILER_DELEGATING_CONSTRUCTORS
0482  *  N2437           Q_COMPILER_EXPLICIT_CONVERSIONS
0483  *  N3206 N3272     Q_COMPILER_EXPLICIT_OVERRIDES
0484  *  N1987           Q_COMPILER_EXTERN_TEMPLATES
0485  *  N2540           Q_COMPILER_INHERITING_CONSTRUCTORS
0486  *  N2672           Q_COMPILER_INITIALIZER_LISTS
0487  *  N2658 N2927     Q_COMPILER_LAMBDA                   __cpp_lambdas = 200907
0488  *  N2756           Q_COMPILER_NONSTATIC_MEMBER_INIT
0489  *  N2855 N3050     Q_COMPILER_NOEXCEPT
0490  *  N2431           Q_COMPILER_NULLPTR
0491  *  N2930           Q_COMPILER_RANGE_FOR
0492  *  N2442           Q_COMPILER_RAW_STRINGS              __cpp_raw_strings = 200710
0493  *  N2439           Q_COMPILER_REF_QUALIFIERS
0494  *  N2118 N2844 N3053 Q_COMPILER_RVALUE_REFS            __cpp_rvalue_references = 200610
0495  *  N1720           Q_COMPILER_STATIC_ASSERT            __cpp_static_assert = 200410
0496  *  N2258           Q_COMPILER_TEMPLATE_ALIAS
0497  *  N2659           Q_COMPILER_THREAD_LOCAL
0498  *  N2660           Q_COMPILER_THREADSAFE_STATICS
0499  *  N2765           Q_COMPILER_UDL                      __cpp_user_defined_literals = 200809
0500  *  N2442           Q_COMPILER_UNICODE_STRINGS          __cpp_unicode_literals = 200710
0501  *  N2640           Q_COMPILER_UNIFORM_INIT
0502  *  N2544           Q_COMPILER_UNRESTRICTED_UNIONS
0503  *  N1653           Q_COMPILER_VARIADIC_MACROS
0504  *  N2242 N2555     Q_COMPILER_VARIADIC_TEMPLATES       __cpp_variadic_templates = 200704
0505  *
0506  *
0507  * For the C++ standards C++14 and C++17, we use only the SD-6 macro.
0508  *
0509  * For any future version of the C++ standard, we use only the C++20 feature test macro.
0510  * For library features, we assume <version> is present (this header includes it).
0511  *
0512  * For a full listing of feature test macros, see
0513  *  https://en.cppreference.com/w/cpp/feature_test
0514  * Exceptions:
0515  *  Q_DECL_CONSTEXPR_DTOR           constexpr in C++20 for explicit destructors __cpp_constexpr >= 201907L
0516  *  Q_CONSTEXPR_DTOR                constexpr in C++20 for variables __cpp_constexpr >= 201907L otherwise const
0517  *  Q_DECL_EQ_DELETE_X(message)     = delete("reason"), __cpp_deleted_function >= 202403L
0518  *
0519  * C++ extensions:
0520  *  Q_COMPILER_RESTRICTED_VLA       variable-length arrays, prior to __cpp_runtime_arrays
0521  */
0522 
0523 /*
0524  * Now that we require C++17, we unconditionally expect threadsafe statics mandated since C++11
0525  */
0526 #define Q_COMPILER_THREADSAFE_STATICS
0527 
0528 #if defined(Q_CC_CLANG)
0529 /* General C++ features */
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 // Clang supports binary literals in C, C++98 and C++11 modes
0536 // It's been supported "since the dawn of time itself" (cf. commit 179883)
0537 #  if __has_extension(cxx_binary_literals)
0538 #    define Q_COMPILER_BINARY_LITERALS
0539 #  endif
0540 
0541 // Variadic macros are supported for gnu++98, c++11, c99 ... since 2.9
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 /* C++11 features, see http://clang.llvm.org/cxx_status.html */
0551 #  if (defined(__cplusplus) && __cplusplus >= 201103L) \
0552       || defined(__GXX_EXPERIMENTAL_CXX0X__)
0553     /* Detect C++ features using __has_feature(), see http://clang.llvm.org/docs/LanguageExtensions.html#cxx11 */
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 /* CLANG 3.2 has bad/partial support */
0572 #      define Q_COMPILER_CONSTEXPR
0573 #    endif
0574 #    if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */
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 /* both covered by this feature macro, according to docs */
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__) /* FreeBSD clang fails on __cxa_thread_atexit */
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     /* Features that have no __has_feature() check */
0647 #    if Q_CC_CLANG >= 209 /* since clang 2.9 */
0648 #      define Q_COMPILER_EXTERN_TEMPLATES
0649 #    endif
0650 #  endif // (defined(__cplusplus) && __cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
0651 
0652 /* C++1y features, deprecated macros. Do not update this list. */
0653 #  if defined(__cplusplus) && __cplusplus > 201103L
0654 //#    if __has_feature(cxx_binary_literals)
0655 //#      define Q_COMPILER_BINARY_LITERALS  // see above
0656 //#    endif
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 // if defined(__cplusplus) && __cplusplus > 201103L
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__) /* FreeBSD clang fails on __cxa_thread_atexit */
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 //  defined(Q_CC_CLANG)
0693 
0694 #if defined(Q_CC_GNU_ONLY)
0695 #  define Q_COMPILER_RESTRICTED_VLA
0696 #  if Q_CC_GNU >= 403
0697 //   GCC supports binary literals in C, C++98 and C++11 modes
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      // Variadic macros are supported for gnu++98, c++11, C99 ... since forever (gcc 2.97)
0704 #    define Q_COMPILER_VARIADIC_MACROS
0705 #  endif
0706 #  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
0707 #    if Q_CC_GNU >= 403
0708        /* C++11 features supported in GCC 4.3: */
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        /* C++11 features supported in GCC 4.4: */
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        /* C++11 features supported in GCC 4.5: */
0724 #      define Q_COMPILER_EXPLICIT_CONVERSIONS
0725        /* GCC 4.4 implements initializer_list but does not define typedefs required
0726         * by the standard. */
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        /* Pre-4.6 compilers implement a non-final snapshot of N2346, hence default and delete
0734         * functions are supported only if they are public. Starting from 4.6, GCC handles
0735         * final version - the access modifier is not relevant. */
0736 #      define Q_COMPILER_DEFAULT_MEMBERS
0737 #      define Q_COMPILER_DELETE_MEMBERS
0738        /* C++11 features supported in GCC 4.6: */
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        /* GCC 4.4 implemented <atomic> and std::atomic using its old intrinsics.
0745         * However, the implementation is incomplete for most platforms until GCC 4.7:
0746         * instead, std::atomic would use an external lock. Since we need an std::atomic
0747         * that is behavior-compatible with QBasicAtomic, we only enable it here */
0748 #      define Q_COMPILER_ATOMICS
0749        /* GCC 4.6.x has problems dealing with noexcept expressions,
0750         * so turn the feature on for 4.7 and above, only */
0751 #      define Q_COMPILER_NOEXCEPT
0752        /* C++11 features supported in GCC 4.7: */
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        /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole
0771         * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */
0772 #      define Q_COMPILER_CONSTEXPR
0773 #    endif
0774 #  endif
0775 #  if __cplusplus > 201103L
0776 #    if Q_CC_GNU >= 409
0777      /* C++1y features in GCC 4.9 - deprecated, do not update this list */
0778 //#    define Q_COMPILER_BINARY_LITERALS   // already supported since GCC 4.3 as an extension
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        /* C11 features supported in GCC 4.7: */
0786 #      define Q_COMPILER_STATIC_ASSERT
0787 #    endif
0788 #    if Q_CC_GNU >= 409 && defined(__has_include)
0789        /* C11 features supported in GCC 4.9: */
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        /* C++11 features supported in VC8 = VC2005: */
0800 #      define Q_COMPILER_VARIADIC_MACROS
0801 
0802        /* 2005 supports the override and final contextual keywords, in
0803         the same positions as the C++11 variants, but 'final' is
0804         called 'sealed' instead:
0805         http://msdn.microsoft.com/en-us/library/0w2w91tf%28v=vs.80%29.aspx
0806         The behavior is slightly different in C++/CLI, which requires the
0807         "virtual" keyword to be present too, so don't define for that.
0808         So don't define Q_COMPILER_EXPLICIT_OVERRIDES (since it's not
0809         the same as the C++11 version), but define the Q_DECL_* flags
0810         accordingly. */
0811        /* C++11 features supported in VC10 = VC2010: */
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        /* C++11 features supported in VC11 = VC2012: */
0821 #      define Q_COMPILER_EXPLICIT_OVERRIDES /* ...and use std C++11 now   */
0822 #      define Q_COMPILER_CLASS_ENUM
0823 #      define Q_COMPILER_ATOMICS
0824        /* C++11 features in VC12 = VC2013 */
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 // VC 12 SP 2 RC
0833        /* C++11 features in VC14 = VC2015 */
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 // Almost working, see https://connect.microsoft.com/VisualStudio/feedback/details/2011648
0848 //#      define Q_COMPILER_CONSTEXPR
0849 #      define Q_COMPILER_UNIFORM_INIT
0850 #    endif
0851 #    if _MSC_VER >= 1910
0852 #      define Q_COMPILER_CONSTEXPR
0853 #    endif
0854 // MSVC versions before 19.36 have a bug in C++20 comparison implementation.
0855 // This leads to ambiguities when resolving comparison operator overloads in
0856 // certain scenarios (the buggy MSVC versions were checked using our CI and
0857 // compiler explorer).
0858 #    if _MSC_VER < 1936
0859 #      define Q_COMPILER_LACKS_THREE_WAY_COMPARE_SYMMETRY
0860 #    endif
0861 // QTBUG-124376: MSVC is slow at compiling qstrnlen()
0862 #    define Q_COMPILER_SLOW_QSTRNLEN_COMPILATION
0863 #  endif /* __cplusplus */
0864 #endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
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 // By default, QNX 7.0 uses libc++ (from LLVM) and
0876 // QNX 6.X uses Dinkumware's libcpp. In all versions,
0877 // it is also possible to use GNU libstdc++.
0878 
0879 // For Dinkumware, some features must be disabled
0880 // (mostly because of library problems).
0881 // Dinkumware is assumed when __GLIBCXX__ (GNU libstdc++)
0882 // and _LIBCPP_VERSION (LLVM libc++) are both absent.
0883 #  if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
0884 
0885 // Older versions of libcpp (QNX 650) do not support C++11 features
0886 // _HAS_* macros are set to 1 by toolchains that actually include
0887 // Dinkum C++11 libcpp.
0888 
0889 #   if !defined(_HAS_CPP0X) || !_HAS_CPP0X
0890 // Disable C++11 features that depend on library support
0891 #    undef Q_COMPILER_INITIALIZER_LISTS
0892 #    undef Q_COMPILER_RVALUE_REFS
0893 #    undef Q_COMPILER_REF_QUALIFIERS
0894 #    undef Q_COMPILER_NOEXCEPT
0895 // Disable C++11 library features:
0896 #    undef Q_STDLIB_UNICODE_STRINGS
0897 #   endif // !_HAS_CPP0X
0898 #   if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
0899 #    undef Q_COMPILER_NULLPTR
0900 #   endif //!_HAS_NULLPTR_T
0901 #   if !defined(_HAS_CONSTEXPR) || !_HAS_CONSTEXPR
0902 // The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min()
0903 // Disable constexpr support on QNX even if the compiler supports it
0904 #    undef Q_COMPILER_CONSTEXPR
0905 #   endif // !_HAS_CONSTEXPR
0906 #  endif // !__GLIBCXX__ && !_LIBCPP_VERSION
0907 # endif // Q_OS_QNX
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 // Apple has not updated libstdc++ since 2007, which means it does not have
0911 // <initializer_list> or std::move. Let's disable these features
0912 #   undef Q_COMPILER_INITIALIZER_LISTS
0913 #   undef Q_COMPILER_RVALUE_REFS
0914 #   undef Q_COMPILER_REF_QUALIFIERS
0915 // Also disable <atomic>, since it's clearly not there
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 // Only supported on macOS 14 and iOS 17
0922 #  endif
0923 # endif // defined(Q_CC_CLANG) && defined(Q_OS_DARWIN)
0924 #endif
0925 
0926 // Don't break code that is already using Q_COMPILER_DEFAULT_DELETE_MEMBERS
0927 #if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
0928 #  define Q_COMPILER_DEFAULT_DELETE_MEMBERS
0929 #endif
0930 
0931 /*
0932  * Compatibility macros for C++11/14 keywords and expressions.
0933  * Don't use in new code and port away whenever you have a chance.
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) /* P0188R1 */) || \
0964     (!defined(__cplusplus) && __has_c_attribute(nodiscard) /* N2267 */)
0965 #  undef Q_REQUIRED_RESULT
0966 #  define Q_REQUIRED_RESULT [[nodiscard]]
0967 #endif
0968 
0969 #if (defined(__cplusplus) && __has_cpp_attribute(nodiscard) >= 201907L /* used for both P1771 and P1301... */) \
0970     || (!defined(__cplusplus) && __has_c_attribute(nodiscard) /* N2448 */)
0971 // [[nodiscard]] constructor (P1771)
0972 #  ifndef Q_NODISCARD_CTOR
0973 #    define Q_NODISCARD_CTOR [[nodiscard]]
0974 #  endif
0975 // [[nodiscard("reason")]] (P1301, N2448 for C)
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 // Clang < 20 advertises the feature-testing macro but issues a warning
1029 // if one isn't also using C++26,
1030 // https://github.com/llvm/llvm-project/issues/109311
1031 #  if defined(__cpp_deleted_function) && __cpp_deleted_function >= 202403L \
1032     && (!defined(Q_CC_CLANG_ONLY) || Q_CC_CLANG_ONLY >= 2000 || __cplusplus > 202302L) // C++26
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  * Fallback macros to certain compiler features
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  * "Weak overloads" - makes an otherwise confliciting overload weaker
1141  * (by making it a template)
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  * If one wants to add functions that use post-C++17 APIs, one needs to:
1151  *
1152  * 1) make them fully inline; and
1153  * 2) guard them using the necessary feature-testing macros.
1154  *
1155  * This decouples the C++ version used to build Qt with the one used by
1156  * end-user applications; Qt and the application can either choose any C++
1157  * version.
1158  *
1159  * A problem arises on MSVC for member functions of exported classes. Client
1160  * code that tries to use such a function will see it as exported, and simply
1161  * try to consume the function's *symbol*. However, if Qt has been built in
1162  * C++17, it won't have such a symbol, and linking will fail.
1163  *
1164  * The workaround: declare such functions as function templates.
1165  * (Obviously a function template does not need this marker.)
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  * Warning/diagnostic handling
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                           /* not needed */
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       // All other compilers, GCC < 4.6 and MSVC < 2008
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 // The body must be a statement:
1231 #define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
1232 
1233 // This macro can be used to calculate member offsets for types with a non standard layout.
1234 // It uses the fact that offsetof() is allowed to support those types since C++17 as an optional
1235 // feature. All our compilers do support this, but some issue a warning, so we wrap the offsetof()
1236 // call in a macro that disables the compiler warning.
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    Proper for-scoping in MIPSpro CC
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 // !defined(__cplusplus)
1268 #  if __has_c_attribute(fallthrough)
1269 #    define Q_FALLTHROUGH() [[fallthrough]]
1270 #  endif
1271 #endif // !defined(__cplusplus)
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     Sanitize compiler feature availability
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 // Compiler version check
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 // __cplusplus
1316 
1317 #if defined(__cplusplus) && defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
1318 #  if Q_CC_MSVC < 1927
1319      // Check below only works with 16.7 or newer
1320 #    error "Qt requires at least Visual Studio 2019 version 16.7 (VC++ version 14.27). Please upgrade."
1321 #  endif
1322 
1323 // On MSVC we require /permissive- set by user code. Check that we are
1324 // under its rules -- for instance, check that std::nullptr_t->bool is
1325 // not an implicit conversion, as per
1326 // https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-160#nullptr_t-is-only-convertible-to-bool-as-a-direct-initialization
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 // this is fine
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 // enable gcc warnings for printf-style functions
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 //defines the type for the WNDPROC on windows
1380 //the alignment needs to be forced for sse2 to not crash with mingw
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    // https://developercommunity.visualstudio.com/t/C:-constinit-for-an-optional-fails-if-/1406069
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    Avoid some particularly useless warnings from some stupid compilers.
1422    To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
1423    the line "#define QT_NO_WARNINGS". See also QTBUG-26877.
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) /* class 'type' needs to have dll-interface to be used by clients of class 'type2' */
1431 QT_WARNING_DISABLE_MSVC(4244) /* conversion from 'type1' to 'type2', possible loss of data */
1432 QT_WARNING_DISABLE_MSVC(4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */
1433 QT_WARNING_DISABLE_MSVC(4514) /* unreferenced inline function has been removed */
1434 QT_WARNING_DISABLE_MSVC(4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
1435 QT_WARNING_DISABLE_MSVC(4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
1436 QT_WARNING_DISABLE_MSVC(4706) /* assignment within conditional expression */
1437 QT_WARNING_DISABLE_MSVC(4355) /* 'this' : used in base member initializer list */
1438 QT_WARNING_DISABLE_MSVC(4710) /* function not inlined */
1439 QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */
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 // libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
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 // P0846 doesn't have a feature macro :/
1467 # if !defined(Q_CC_MSVC_ONLY) || Q_CC_MSVC >= 1939 // claims C++20 support but lacks P0846
1468                                                    // 1939 is known to work
1469                                                    // 1936 is known to fail
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         /* end */
1482 #endif // !P0846
1483 
1484 #endif // __cplusplus
1485 
1486 #endif // QCOMPILERDETECTION_H