Skip to content

Commit 43889fa

Browse files
authored
zend_portability: Use [[fallthrough]] for C23 and C++ (#21904)
1 parent dec3658 commit 43889fa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Zend/zend_portability.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@
130130
#endif
131131

132132
/* pseudo fallthrough keyword; */
133-
#if defined(__GNUC__) && __GNUC__ >= 7
133+
#if __STDC_VERSION__ >= 202311L || defined(__cplusplus)
134+
# define ZEND_FALLTHROUGH [[fallthrough]]
135+
#elif defined(__GNUC__) && __GNUC__ >= 7
134136
# define ZEND_FALLTHROUGH __attribute__((__fallthrough__))
135137
#else
136138
# define ZEND_FALLTHROUGH ((void)0)

0 commit comments

Comments
 (0)