From b6f784f00eac8008cb61d7bc6f53c05eee0ca394 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 2 Jul 2016 02:02:11 +0200 Subject: [PATCH] Add macro for fallthrough in switch-case --- application/global.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/global.h b/application/global.h index e8cd448..2a616d3 100644 --- a/application/global.h +++ b/application/global.h @@ -86,4 +86,16 @@ # define IF_DEBUG_BUILD(x) #endif +/*! + * \def FALLTHROUGH + * \brief Prevents clang from warning about missing break in switch-case. + * \remarks Does nothing if another compiler is used. + */ + +#ifdef __clang__ +# define FALLTHROUGH [[clang::fallthrough]] +# else +# define FALLTHROUGH +#endif + #endif // APPLICATION_UTILITIES_GLOBAL_H