From 9f2dc6d17f84cebf4e48f18459d9b39289f5da86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Sun, 26 May 2024 14:08:30 +0200 Subject: [PATCH] Fixup (u)int128 to latin support MSVC compilers that could use both branches ended up using one branch for some things and another branch for other things, which didn't mix and caused build failures. And in the header the #include was inside the Qt namespace and caused internal build errors during parse. Amends 9d693dbfb14664eed285dfe35ebabba187dd1602 Change-Id: I1a77abe1fefd21ea3256f5b2d5a55998257762e5 Reviewed-by: Christian Ehrlicher --- src/corelib/text/qlocale_tools.cpp | 6 +++--- src/corelib/text/qlocale_tools_p.h | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/corelib/text/qlocale_tools.cpp b/src/corelib/text/qlocale_tools.cpp index 52124672ca6..b68090365b8 100644 --- a/src/corelib/text/qlocale_tools.cpp +++ b/src/corelib/text/qlocale_tools.cpp @@ -810,10 +810,10 @@ QByteArray qdtoAscii(double d, QLocaleData::DoubleForm form, int precision, bool #if defined(QT_SUPPORTS_INT128) || (defined(Q_CC_MSVC) && (_MSC_VER >= 1930)) static inline quint64 toUInt64(qinternaluint128 v) { -#ifdef Q_CC_MSVC - return quint64(v._Word[0]); -#else +#ifdef QT_SUPPORTS_INT128 return quint64(v); +#elif defined(Q_CC_MSVC) + return quint64(v._Word[0]); #endif } QString quint128toBasicLatin(qinternaluint128 number, int base) diff --git a/src/corelib/text/qlocale_tools_p.h b/src/corelib/text/qlocale_tools_p.h index ef1e156f50b..9ae9dc8de74 100644 --- a/src/corelib/text/qlocale_tools_p.h +++ b/src/corelib/text/qlocale_tools_p.h @@ -18,13 +18,16 @@ #include "qlocale_p.h" #include "qstring.h" +#if !defined(QT_SUPPORTS_INT128) && defined(Q_CC_MSVC) && (_MSC_VER >= 1930) +#include <__msvc_int128.hpp> +#endif + QT_BEGIN_NAMESPACE #if defined(QT_SUPPORTS_INT128) using qinternalint128 = qint128; using qinternaluint128 = quint128; #elif defined(Q_CC_MSVC) && (_MSC_VER >= 1930) -#include <__msvc_int128.hpp> using qinternalint128 = std::_Signed128; using qinternaluint128 = std::_Unsigned128; #endif