Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,35 @@ AC_CHECK_FUNC([sigsetjmp],,
[AC_MSG_FAILURE([Required sigsetjmp not found.])],
[#include <setjmp.h>])])


ZEND_CHECK_STACK_DIRECTION
ZEND_CHECK_FLOAT_PRECISION
ZEND_DLSYM_CHECK
ZEND_CHECK_GLOBAL_REGISTER_VARIABLES
ZEND_CHECK_PRESERVE_NONE

case $host_os in
darwin*)
dnl versions prior to this lead to compilation failure
dnl Prefer __apple_build_version__ (reliable, numeric) when available.
dnl The known-good minimum corresponds to 17000404 (see PR discussion).
min_apple_build_version=17000404
apple_build_version=`echo | $CC -dM -E -x c - 2>/dev/null | sed -n 's/^#define __apple_build_version__ \([0-9][0-9]*\)$/\1/p'`

AS_IF([test -n "$apple_build_version"], [
AC_MSG_CHECKING([Apple clang __apple_build_version__ >= $min_apple_build_version])
AS_IF([test "$apple_build_version" -ge "$min_apple_build_version"], [
ZEND_CHECK_PRESERVE_NONE
])
], [
dnl Not Apple clang (could be Homebrew clang, GCC, etc.) -> keep enabled
ZEND_CHECK_PRESERVE_NONE
])
;;
*)
ZEND_CHECK_PRESERVE_NONE
;;
esac

ZEND_CHECK_CPUID_COUNT

AC_MSG_CHECKING([whether to enable thread safety])
Expand Down
3 changes: 3 additions & 0 deletions Zend/zend_portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,13 @@ char *alloca();
# define ZEND_PRESERVE_NONE __attribute__((preserve_none))
#endif


#if !defined(__apple_build_version__) || (defined(__apple_build_version__) && __apple_build_version__ >= 17000404)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please indent the nested cpp directives (with a space after the #)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not get your suggestion @henderkes, it is not within a nested part is it ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, didn't see the #endif just above. Ignore the suggestion then.

#if __has_attribute(musttail)
# define HAVE_MUSTTAIL
# define ZEND_MUSTTAIL __attribute__((musttail))
#endif
#endif

#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
# define HAVE_NORETURN
Expand Down