diff options
author | Richard Braun <rbraun@sceen.net> | 2018-01-11 20:42:46 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-01-11 21:20:08 +0100 |
commit | 57bc635a352b5772af9b130493f4c90addaa76a3 (patch) | |
tree | 9f90580ff0507258833aaba4d8fe4425a784b672 | |
parent | e70045fbe4b9536294e3c23aa4d55fa6f1ce3f60 (diff) |
macros: new __fallthrough macro
-rw-r--r-- | src/macros.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h index 280759c..3a13bc9 100644 --- a/src/macros.h +++ b/src/macros.h @@ -91,4 +91,12 @@ #define __used __attribute__((used)) #endif +#ifndef __fallthrough +#if __GNUC__ >= 7 +#define __fallthrough __attribute__((fallthrough)) +#else /* __GNUC__ >= 7 */ +#define __fallthrough +#endif /* __GNUC__ >= 7 */ +#endif + #endif /* _MACROS_H */ |