abies           Sat Apr  3 05:42:44 2004 EDT

  Modified files:              
    /php-src/ext/standard       config.m4 
  Log:
  MFB: more elaborate HUGE_VAL test
  
http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.71&r2=1.72&ty=u
Index: php-src/ext/standard/config.m4
diff -u php-src/ext/standard/config.m4:1.71 php-src/ext/standard/config.m4:1.72
--- php-src/ext/standard/config.m4:1.71 Mon Mar 29 18:08:34 2004
+++ php-src/ext/standard/config.m4      Sat Apr  3 05:42:42 2004
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.71 2004/03/29 23:08:34 helly Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.72 2004/04/03 10:42:42 abies Exp $ -*- sh -*-
 
 divert(3)dnl
 
@@ -389,7 +389,7 @@
   AC_DEFINE([HAVE_ATOF_ACCEPTS_INF], 1, [whether atof() accepts INF])
 fi
 
-AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL = NAN, ac_cv_huge_val_nan,[
+AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
   AC_TRY_RUN([
 #include <math.h>
 #include <stdlib.h>
@@ -413,9 +413,16 @@
 #define zend_isnan(a) 0
 #endif
 
+double hv(int i)
+{
+       /* avoid inlining */
+       if (i) return hv(i-1);
+       else return HUGE_VAL;
+}
+
 int main(int argc, char** argv)
 {
-       return zend_isinf(HUGE_VAL) && zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
+       return zend_isinf(hv(3)) && zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
 }
   ],[
       ac_cv_huge_val_nan=yes
@@ -427,7 +434,7 @@
 ])
 dnl This is the most probable fallback so we assume yes in case of cross compile.
 if test "$ac_cv_huge_val_nan" = "yes"; then
-  AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL = NAN])
+  AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
 fi
 
 PHP_CHECK_I18N_FUNCS

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to