Fix the static_assert for 128-bit integer types
Testing for Standard Library features with compiler version macros was incorrect. This commit fixes that to check the correct macros. That fixes the use of Clang-cl / ICX because Microsoft STL doesn't have support for 128-bit integers (because Microsoft's compiler doesn't) but Clang does. Amends 104a0a9ecdb18d65e4d9075d87e8860c6c9d8335. Fixes: QTBUG-117870 Change-Id: I85599ea5ca7a4b79a8bbfffd178b9688e7c1bf42 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 19f54b901ffbc9108875dc0d7d91138bc9d1c1ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
cf631ab8d2
commit
3b873fb7a9
@ -513,11 +513,14 @@ static_assert(sizeof(qint128) == 16, "Internal error, qint128 is misdefined");
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QT_SUPPORTS_INT128
|
#ifdef QT_SUPPORTS_INT128
|
||||||
// check that numeric_limits works:
|
// Standard Library supports for 128-bit integers:
|
||||||
// This fails here for GCC 9, but succeeds on Clang and GCC >= 11
|
// Implementation | Version | Note
|
||||||
// However, all tests in tst_qglobal::int128Literals() pass for GCC 9, too,
|
// ---------------------|---------|------
|
||||||
// so just suppress the check for older GCC:
|
// GNU libstdc++ | 11.1.0 |
|
||||||
# if !defined(Q_CC_GNU_ONLY) || Q_CC_GNU >= 1100
|
// LLVM libc++ | 3.5 | May change if compiler has __is_integral()
|
||||||
|
// MS STL | none |
|
||||||
|
|
||||||
|
# if defined(_LIBCPP_VERSION) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 11)
|
||||||
static_assert(std::numeric_limits<quint128>::max() == Q_UINT128_MAX);
|
static_assert(std::numeric_limits<quint128>::max() == Q_UINT128_MAX);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user