aboutsummaryrefslogtreecommitdiff
path: root/lib/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.h')
-rw-r--r--lib/util.h8
1 files changed, 8 insertions, 0 deletions
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