Browse Source

fp_except check for FreeBSD 1.0-2.2.5

PHP-4.0.5
Sascha Schumann 26 years ago
parent
commit
15925864b2
  1. 2
      Zend/Zend.m4
  2. 18
      Zend/acinclude.m4
  3. 8
      Zend/zend.c

2
Zend/Zend.m4

@ -67,6 +67,8 @@ AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(finite isfinite isinf isnan)
ZEND_FP_EXCEPT
AC_SUBST(ZEND_SCANNER)
])

18
Zend/acinclude.m4

@ -2,6 +2,24 @@ dnl $Id$
dnl
dnl This file contains local autoconf functions.
AC_DEFUN(ZEND_FP_EXCEPT,[
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
AC_TRY_COMPILE([
#include <floatingpoint.h>
],[
fp_except x = (fp_except) 0;
],[
ac_cv_type_fp_except=yes
],[
ac_cv_type_fp_except=no
],[
ac_cv_type_fp_except=no
])])
if test "$ac_cv_type_fp_except" = "yes"; then
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
fi
])
dnl
dnl Check for broken sprintf()
dnl

8
Zend/zend.c

@ -329,8 +329,12 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
#ifdef __FreeBSD__
{
/* FreeBSD floating point precision fix */
fp_except_t mask;
#ifdef HAVE_FP_EXCEPT
fp_except
#else
fp_except_t
#endif
mask;
mask = fpgetmask();
fpsetmask(mask & ~FP_X_IMP);

Loading…
Cancel
Save