From db5dabf5ee417edff9e893372966fd6194b404e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 28 Apr 2026 22:59:59 +0200 Subject: [PATCH] zend_portability: Use `[[fallthrough]]` for C23 and C++ --- Zend/zend_portability.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)