aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/jobs/syncjob.cpp2
-rw-r--r--lib/util.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/jobs/syncjob.cpp b/lib/jobs/syncjob.cpp
index f9f5666e..cbdc37b4 100644
--- a/lib/jobs/syncjob.cpp
+++ b/lib/jobs/syncjob.cpp
@@ -129,7 +129,7 @@ SyncRoomData::SyncRoomData(const QString& roomId_, JoinState joinState_,
case JoinState::Join:
ephemeral = load<Events>(room_, "ephemeral");
accountData = load<Events>(room_, "account_data");
- // [[fallthrough]]
+ FALLTHROUGH;
case JoinState::Leave:
{
timeline = load<RoomEvents>(room_, "timeline");
diff --git a/lib/util.h b/lib/util.h
index 8c925d71..d6e1cef6 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -27,6 +27,14 @@
#include <functional>
#include <memory>
+#if __cplusplus >= 201703L
+#define FALLTHROUGH [[fallthrough]]
+#elif __has_cpp_attribute(clang::fallthrough)
+#define FALLTHROUGH [[clang::fallthrough]]
+#else
+#define FALLTHROUGH // -fallthrough
+#endif
+
namespace QMatrixClient
{
// The below enables pretty-printing of enums in logs