Add macro for fallthrough in switch-case

This commit is contained in:
Martchus 2016-07-02 02:02:11 +02:00
parent cb4246e202
commit b6f784f00e
1 changed files with 12 additions and 0 deletions

View File

@ -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