Windows: Fix "__msvc_int128.hpp" inclusion
The "__msvc_int128.hpp" file is not available in MSVC 17.1.5 Change-Id: Iebc611342ffe5baafb8469205e14afc41b55be5f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1b3ae003e657074a9b3cc5a8e5212a40cf02c0fd) Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
This commit is contained in:
parent
92ffa3a7a5
commit
b907752a2c
@ -807,15 +807,16 @@ QByteArray qdtoAscii(double d, QLocaleData::DoubleForm form, int precision, bool
|
|||||||
return dtoString<QByteArray>(d, form, precision, uppercase);
|
return dtoString<QByteArray>(d, form, precision, uppercase);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(QT_SUPPORTS_INT128) || (defined(Q_CC_MSVC) && (_MSC_VER >= 1930))
|
#if defined(QT_SUPPORTS_INT128) || defined(QT_USE_MSVC_INT128)
|
||||||
static inline quint64 toUInt64(qinternaluint128 v)
|
static inline quint64 toUInt64(qinternaluint128 v)
|
||||||
{
|
{
|
||||||
#ifdef QT_SUPPORTS_INT128
|
#if defined(QT_USE_MSVC_INT128)
|
||||||
return quint64(v);
|
|
||||||
#elif defined(Q_CC_MSVC)
|
|
||||||
return quint64(v._Word[0]);
|
return quint64(v._Word[0]);
|
||||||
|
#else
|
||||||
|
return quint64(v);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString quint128toBasicLatin(qinternaluint128 number, int base)
|
QString quint128toBasicLatin(qinternaluint128 number, int base)
|
||||||
{
|
{
|
||||||
// We divide our 128-bit number into parts that we can do text
|
// We divide our 128-bit number into parts that we can do text
|
||||||
@ -879,6 +880,6 @@ QString qint128toBasicLatin(qinternalint128 number, int base)
|
|||||||
result.prepend(u'-');
|
result.prepend(u'-');
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif // defined(QT_SUPPORTS_INT128) || (defined(Q_CC_MSVC) && (_MSC_VER >= 1930))
|
#endif // defined(QT_SUPPORTS_INT128) || defined(QT_USE_MSVC_INT128)
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
#include "qlocale_p.h"
|
#include "qlocale_p.h"
|
||||||
#include "qstring.h"
|
#include "qstring.h"
|
||||||
|
|
||||||
#if !defined(QT_SUPPORTS_INT128) && defined(Q_CC_MSVC) && (_MSC_VER >= 1930)
|
#if !defined(QT_SUPPORTS_INT128) && (defined(Q_CC_MSVC) && (_MSC_VER >= 1930) && __has_include(<__msvc_int128.hpp>))
|
||||||
#include <__msvc_int128.hpp>
|
#include <__msvc_int128.hpp>
|
||||||
|
#define QT_USE_MSVC_INT128
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -27,7 +28,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
#if defined(QT_SUPPORTS_INT128)
|
#if defined(QT_SUPPORTS_INT128)
|
||||||
using qinternalint128 = qint128;
|
using qinternalint128 = qint128;
|
||||||
using qinternaluint128 = quint128;
|
using qinternaluint128 = quint128;
|
||||||
#elif defined(Q_CC_MSVC) && (_MSC_VER >= 1930)
|
#elif defined(QT_USE_MSVC_INT128)
|
||||||
using qinternalint128 = std::_Signed128;
|
using qinternalint128 = std::_Signed128;
|
||||||
using qinternaluint128 = std::_Unsigned128;
|
using qinternaluint128 = std::_Unsigned128;
|
||||||
#endif
|
#endif
|
||||||
@ -55,7 +56,7 @@ void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision,
|
|||||||
[[nodiscard]] QByteArray qdtoAscii(double d, QLocaleData::DoubleForm form,
|
[[nodiscard]] QByteArray qdtoAscii(double d, QLocaleData::DoubleForm form,
|
||||||
int precision, bool uppercase);
|
int precision, bool uppercase);
|
||||||
|
|
||||||
#if defined(QT_SUPPORTS_INT128) || (defined(Q_CC_MSVC) && (_MSC_VER >= 1930))
|
#if defined(QT_SUPPORTS_INT128) || defined(QT_USE_MSVC_INT128)
|
||||||
[[nodiscard]] Q_CORE_EXPORT QString quint128toBasicLatin(qinternaluint128 number,
|
[[nodiscard]] Q_CORE_EXPORT QString quint128toBasicLatin(qinternaluint128 number,
|
||||||
int base = 10);
|
int base = 10);
|
||||||
[[nodiscard]] Q_CORE_EXPORT QString qint128toBasicLatin(qinternalint128 number,
|
[[nodiscard]] Q_CORE_EXPORT QString qint128toBasicLatin(qinternalint128 number,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user