cvs: php-src(PHP_4_3) /ext/standard basic_functions.c config.m4

From: Date: Mon, 10 May 2004 07:25:11 +0000
Subject: cvs: php-src(PHP_4_3) /ext/standard basic_functions.c config.m4
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-27308@lists.php.net to get a copy of this message
helly Mon May 10 03:25:11 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard basic_functions.c config.m4 Log: MFH Decouple NAN and INF http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.543.2.36&r2=1.543.2.37&ty=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.543.2.36 php-src/ext/standard/basic_functions.c:1.543.2.37 --- php-src/ext/standard/basic_functions.c:1.543.2.36 Fri Apr 2 04:33:49 2004 +++ php-src/ext/standard/basic_functions.c Mon May 10 03:25:11 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.543.2.36 2004/04/02 09:33:49 derick Exp $ */ +/* $Id: basic_functions.c,v 1.543.2.37 2004/05/10 07:25:11 helly Exp $ */ #include "php.h" #include "php_streams.h" @@ -1004,7 +1004,7 @@ #if HAVE_HUGE_VAL_NAN return HUGE_VAL + -HUGE_VAL; #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha) - double val = 0; + double val = 0.0; ((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH; ((php_uint32*)&val)[0] = 0; return val; @@ -1017,10 +1017,10 @@ 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; + double val = 0.0; ((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH; ((php_uint32*)&val)[0] = 0; return val; http://cvs.php.net/diff.php/php-src/ext/standard/config.m4?r1=1.47.2.13&r2=1.47.2.14&ty=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.47.2.13 php-src/ext/standard/config.m4:1.47.2.14 --- php-src/ext/standard/config.m4:1.47.2.13 Sun Apr 4 08:31:38 2004 +++ php-src/ext/standard/config.m4 Mon May 10 03:25:11 2004 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.47.2.13 2004/04/04 12:31:38 helly Exp $ -*- sh -*- +dnl $Id: config.m4,v 1.47.2.14 2004/05/10 07:25:11 helly Exp $ -*- sh -*- divert(3)dnl @@ -326,7 +326,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> @@ -342,6 +342,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) @@ -356,7 +378,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 } ],[

« previous php.cvs (#27308) next »