summaryrefslogtreecommitdiff
path: root/libre/quassel/0002-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libre/quassel/0002-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch')
-rw-r--r--libre/quassel/0002-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/libre/quassel/0002-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch b/libre/quassel/0002-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch
new file mode 100644
index 000000000..734501fb5
--- /dev/null
+++ b/libre/quassel/0002-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Manuel Nickschas <sputnick@quassel-irc.org>
+Date: Tue, 7 Jan 2020 18:34:54 +0100
+Subject: [PATCH] common: Disable enum type stream operators for Qt >= 5.14
+
+Starting from version 5.14, Qt provides stream operators for enum
+types, which collide with the ones we ship in types.h. Disable
+Quassel's stream operators when compiling against Qt 5.14 or later.
+
+Add a unit test that ensures that enum serialization honors the width
+of the underlying type.
+---
+ src/common/types.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/common/types.h b/src/common/types.h
+index 467d9fb2..c4b9f364 100644
+--- a/src/common/types.h
++++ b/src/common/types.h
+@@ -140,6 +140,7 @@ Q_DECLARE_METATYPE(QHostAddress)
+ typedef QList<MsgId> MsgIdList;
+ typedef QList<BufferId> BufferIdList;
+
++#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ /**
+ * Catch-all stream serialization operator for enum types.
+ *
+@@ -169,6 +170,7 @@ QDataStream &operator>>(QDataStream &in, T &value) {
+ value = static_cast<T>(v);
+ return in;
+ }
++#endif
+
+ // Exceptions
+