helly           Mon May 10 03:23:38 2004 EDT

  Modified files:              
    /php-src/ext/standard       basic_functions.c config.m4 
  Log:
  - Decouple NAN and INF
  
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.664&r2=1.665&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.664 
php-src/ext/standard/basic_functions.c:1.665
--- php-src/ext/standard/basic_functions.c:1.664        Thu Apr 22 10:26:03 2004
+++ php-src/ext/standard/basic_functions.c      Mon May 10 03:23:38 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.664 2004/04/22 14:26:03 wez Exp $ */
+/* $Id: basic_functions.c,v 1.665 2004/05/10 07:23:38 helly Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -957,7 +957,7 @@
 #define PHP_DOUBLE_INFINITY_HIGH       0x7ff00000
 #define PHP_DOUBLE_QUIET_NAN_HIGH      0xfff80000
 
-PHPAPI double php_get_nan()
+PHPAPI double php_get_nan(void)
 {
 #if HAVE_HUGE_VAL_NAN
        return HUGE_VAL + -HUGE_VAL;
@@ -973,9 +973,9 @@
 #endif
 }
 
-PHPAPI double php_get_inf()
+PHPAPI double php_get_inf(void)
 {
-#if HAVE_HUGE_VAL_NAN
+#if HAVE_HUGE_VAL_INF
        return HUGE_VAL;
 #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || 
defined(__alpha)
        double val = 0.0;
http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.74&r2=1.75&ty=u
Index: php-src/ext/standard/config.m4
diff -u php-src/ext/standard/config.m4:1.74 php-src/ext/standard/config.m4:1.75
--- php-src/ext/standard/config.m4:1.74 Sun Apr  4 08:31:12 2004
+++ php-src/ext/standard/config.m4      Mon May 10 03:23:38 2004
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.74 2004/04/04 12:31:12 helly Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.75 2004/05/10 07:23:38 helly 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 == INF, ac_cv_huge_val_inf,[
   AC_TRY_RUN([
 #include <math.h>
 #include <stdlib.h>
@@ -405,6 +405,28 @@
 #define zend_isinf(a) 0
 #endif
 
+int main(int argc, char** argv)
+{
+       return zend_isinf(HUGE_VAL) ? 0 : 1;
+}
+  ],[
+      ac_cv_huge_val_inf=yes
+  ],[
+      ac_cv_huge_val_inf=no
+  ],[
+      ac_cv_huge_val_inf=yes
+  ])
+])
+dnl This is the most probable fallback so we assume yes in case of cross compile.
+if test "$ac_cv_huge_val_inf" = "yes"; then
+  AC_DEFINE([HAVE_HUGE_VAL_INF], 1, [whether HUGE_VAL == INF])
+fi
+
+AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
+  AC_TRY_RUN([
+#include <math.h>
+#include <stdlib.h>
+
 #ifdef HAVE_ISNAN
 #define zend_isnan(a) isnan(a)
 #elif defined(HAVE_FPCLASS)
@@ -419,7 +441,7 @@
        /* prevent bug #27830 */
        return 1;
 #else
-       return zend_isinf(HUGE_VAL) && zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
+       return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
 #endif
 }
   ],[

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

Reply via email to