diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 450e72a60eb5..c5b5fe02929f 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -130,7 +130,9 @@ #endif /* pseudo fallthrough keyword; */ -#if defined(__GNUC__) && __GNUC__ >= 7 +#if __STDC_VERSION__ >= 202311L || defined(__cplusplus) +# define ZEND_FALLTHROUGH [[fallthrough]] +#elif defined(__GNUC__) && __GNUC__ >= 7 # define ZEND_FALLTHROUGH __attribute__((__fallthrough__)) #else # define ZEND_FALLTHROUGH ((void)0)