summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/quuid.h
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-07-24 18:47:15 +0200
committerIvan Solovev <ivan.solovev@qt.io>2023-08-01 10:30:51 +0200
commiteb0abd9789062d95bc62dbbc29b2038dc40472b1 (patch)
tree4f520ab610b85796d38e1f01e97717020d5134e1 /src/corelib/plugin/quuid.h
parent8cedef62cf1b401d2c5ae08b03f92f95fd09df75 (diff)
Use QT_SUPPORTS_INT128 macro to handle 128-bit integral types
Introduce QT_SUPPORTS_INT128 and QT_NO_INT128 marcos to handle 128-bit types. These macros allow to undef Qt's own 128-bit types and the related code, but keep the compiler definitions unchanged. This is required for Qt Bluetooth, where we need to use QT_BLUETOOTH_REMOVED_SINCE to get rid of the APIs using QtBluetooth-specific struct quint128 which clashes with the 128-bit types. The idea is to use QT_NO_INT128 in Qt Bluetooth's removed_api.cpp instead of directly undef'ing __SIZEOF_INT128__, because the latter is UB. This commit amends befda1accab417ce5f55cb11816e6ded51af55e3. Pick-to: 6.6 Change-Id: Ia2c110b5744c3aaa53eda39fb44984cf5a01fac2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin/quuid.h')
-rw-r--r--src/corelib/plugin/quuid.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index ddd24eb678..2cefb4d764 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -60,7 +60,7 @@ public:
quint16 data16[8];
quint32 data32[4];
quint64 data64[2];
-#ifdef __SIZEOF_INT128__
+#ifdef QT_SUPPORTS_INT128
quint128 data128[1];
#endif
@@ -100,7 +100,7 @@ public:
bool isNull() const noexcept;
-#ifdef __SIZEOF_INT128__
+#ifdef QT_SUPPORTS_INT128
constexpr QUuid(quint128 uuid, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept;
constexpr quint128 toUInt128(QSysInfo::Endian order = QSysInfo::BigEndian) const noexcept;
#endif
@@ -242,7 +242,7 @@ inline QUuid QUuid::fromBytes(const void *bytes, QSysInfo::Endian order) noexcep
return QUuid(result, order);
}
-#ifdef __SIZEOF_INT128__
+#ifdef QT_SUPPORTS_INT128
constexpr QUuid::QUuid(quint128 uuid, QSysInfo::Endian order) noexcept
: QUuid()
{