aboutsummaryrefslogtreecommitdiff
path: root/lib/util.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-03 10:47:48 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-03 11:23:07 +0900
commiteaca25fd5115ab00a29b7d47dfc6e16cbfd5e552 (patch)
tree7d9eb709c2a65c9e77dca52f3f66e4c4dcd2095d /lib/util.h
parentded46e7115cf9a3460a780f445a0c8ff22a628fa (diff)
downloadlibquotient-eaca25fd5115ab00a29b7d47dfc6e16cbfd5e552.tar.gz
libquotient-eaca25fd5115ab00a29b7d47dfc6e16cbfd5e552.zip
Roll various switch case fallthrough markers into a macro
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