diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-08-10 18:54:14 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-12 12:08:56 +0000 |
commit | 9ae9cb7157dc6e176416b9b4d69b0a890760c65d (patch) | |
tree | 36edfa996c5c60c04e60a35c51b1c26ee96e3984 /src | |
parent | 716d348cd57cd94034e4b10815e65bc2e2f82d1c (diff) |
QBluetoothUuid: insulate against potentially-disappearing QUuid(quint128) ctor
We're considering remove the QUuid(quint12*) ctor in favor of the
"named" fromUInt128() ctor, so isolate the code against that by going
via the Id128Bytes ctor, which always exists.
This particular way of writing the code requires C++20/C99 designated
initializer support enabled in the compiler. It just so happens that
the only compiler that doesn't support __int128 (MSVC) also is the
only compiler that doesn't allow the use of designated initializers in
C++17 builds (because MSVC never implemented C99), only in C++20+
ones, so for the moment we're ok. If this becomes a problem, we can
rewrite the code.
Change-Id: Ic4424ddad1a8a703e00b2ff3d9b45b07bb321fd0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5fcb55cf2bd45408162d20fe5be407ce6494ba5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qbluetoothuuid.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp index 8f54833b..9449d2f5 100644 --- a/src/bluetooth/qbluetoothuuid.cpp +++ b/src/bluetooth/qbluetoothuuid.cpp @@ -558,7 +558,7 @@ Q_CONSTRUCTOR_FUNCTION(registerQBluetoothUuid) // removed_api.cpp. We need to keep it there, because we need to provide both // implementations for BC QBluetoothUuid::QBluetoothUuid(quint128 uuid) - : QUuid(uuid, QSysInfo::BigEndian) + : QUuid(Id128Bytes{.data128 = {uuid}}, QSysInfo::BigEndian) { } #endif |