summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/plugin/quuid.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index dee97d93a5..05f44b4c25 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -84,6 +84,13 @@ public:
Sha1 = 5 // 0 1 0 1
};
+#ifdef Q_COMPILER_INITIALIZER_LISTS // UNIFORM_INITIALIZATION
+ Q_DECL_CONSTEXPR QUuid()
+ : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {}
+
+ Q_DECL_CONSTEXPR QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8)
+ : data1(l), data2(w1), data3(w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {}
+#else
QUuid()
{
data1 = 0;
@@ -106,6 +113,8 @@ public:
data4[6] = b7;
data4[7] = b8;
}
+#endif
+
#ifndef QT_NO_QUUID_STRING
QUuid(const QString &);
QUuid(const char *);
@@ -142,6 +151,12 @@ public:
#if defined(Q_OS_WIN)
// On Windows we have a type GUID that is used by the platform API, so we
// provide convenience operators to cast from and to this type.
+#ifdef Q_COMPILER_INITIALIZER_LISTS // UNIFORM_INITIALIZATION
+ Q_DECL_CONSTEXPR QUuid(const GUID &guid)
+ : data1(guid.Data1), data2(guid.Data2), data3(guid.Data3),
+ data4{guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
+ guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]} {}
+#else
QUuid(const GUID &guid)
{
data1 = guid.Data1;
@@ -150,6 +165,7 @@ public:
for(int i = 0; i < 8; i++)
data4[i] = guid.Data4[i];
}
+#endif
QUuid &operator=(const GUID &guid)
{