From: Manuel Nickschas Date: Tue, 7 Jan 2020 17:34:54 +0000 (+0100) Subject: [PATCH 1/6] common: Disable enum type stream operators for Qt >= 5.14 X-Git-Tag: archive/raspbian/1%0.13.1-4+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dc22124321bc08c8fe15dd16440b85ee9ae950e6;p=quassel.git [PATCH 1/6] common: Disable enum type stream operators for Qt >= 5.14 From 579e559a6322209df7cd51c34801fecff5fe734b Mon Sep 17 00:00:00 2001 Bug: https://bugs.quassel-irc.org/issues/1544 Bug-Ubuntu: https://bugs.launchpad.net/quassel/+bug/1885436 Origin: upstream, https://github.com/quassel/quassel/pull/518 Origin: upstream, https://github.com/quassel/quassel/commit/579e559a6322209df7cd51c34801fecff5fe734b 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. Gbp-Pq: Topic qt514 Gbp-Pq: Name 0001-common-Disable-enum-type-stream-operators-for-Qt-5.1.patch --- diff --git a/src/common/types.h b/src/common/types.h index 467d9fb..c4b9f36 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -140,6 +140,7 @@ Q_DECLARE_METATYPE(QHostAddress) typedef QList MsgIdList; typedef QList 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(v); return in; } +#endif // Exceptions