Skip to content

Commit 547b985

Browse files
committed
Introduce pseudo-keyword fallthrough
This follows the Linux Kernal C code style
1 parent 8dbaddd commit 547b985

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Zend/zend_portability.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@
113113
# define ZEND_UNREACHABLE() ZEND_ASSUME(0)
114114
#endif
115115

116+
/* pseudo fallthrough keyword; */
117+
#if defined(__GNUC__) && __GNUC__ >= 7
118+
# define fallthrough __attribute__((__fallthrough__))
119+
#else
120+
# define fallthrough ((void)0)
121+
#endif
122+
116123
/* Only use this macro if you know for sure that all of the switches values
117124
are covered by its case statements */
118125
#define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_UNREACHABLE(); break;

0 commit comments

Comments
 (0)