mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Use C23 unreachable() when possible (#19077)
This is a macro defined in stddef, which is already included in this header. Since this is a macro, we can just check for the define rather than add any additional build system checks. Fixes GH-18975
This commit is contained in:
@@ -109,7 +109,10 @@
|
||||
# define ZEND_ASSERT(c) ZEND_ASSUME(c)
|
||||
#endif
|
||||
|
||||
#ifdef PHP_HAVE_BUILTIN_UNREACHABLE
|
||||
/* use C23 unreachable() from <stddef.h> if possible */
|
||||
#ifdef unreachable
|
||||
# define _ZEND_UNREACHABLE() unreachable()
|
||||
#elif defined(PHP_HAVE_BUILTIN_UNREACHABLE)
|
||||
# define _ZEND_UNREACHABLE() __builtin_unreachable()
|
||||
#else
|
||||
# define _ZEND_UNREACHABLE() ZEND_ASSUME(0)
|
||||
|
||||
Reference in New Issue
Block a user