mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix Clang builds regarding undefined function call
While MSVC is apparently fine using `_AddressOfReturnAddress()` without including intrin.h, Clang complains that the function is undefined. So we include the header, if `_MSC_VER` is defined, what is the case for MSVC and clang-cl, but not for some other compilers on Windows (e.g. GCC).
This commit is contained in:
parent
6bd2b8dfa5
commit
ce53dab272
1 changed files with 5 additions and 1 deletions
|
@ -25,6 +25,10 @@
|
|||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_CHECK_STACK_LIMIT
|
||||
|
||||
typedef struct _zend_call_stack {
|
||||
|
@ -38,7 +42,7 @@ ZEND_API bool zend_call_stack_get(zend_call_stack *stack);
|
|||
|
||||
/** Returns an approximation of the current stack position */
|
||||
static zend_always_inline void *zend_call_stack_position(void) {
|
||||
#ifdef ZEND_WIN32
|
||||
#ifdef _MSC_VER
|
||||
return _AddressOfReturnAddress();
|
||||
#elif defined(PHP_HAVE_BUILTIN_FRAME_ADDRESS)
|
||||
return __builtin_frame_address(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue