From: Marcus Boerger Date: Sun, 28 Mar 2004 21:46:43 +0000 (+0000) Subject: Improve portability (idea by Ard) X-Git-Tag: php-5.0.0RC2RC1~180 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f855044c7df79185fb0670be05fdded6297cf3d;p=php Improve portability (idea by Ard) --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 28a26b5948..6cb1a6f422 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -957,9 +957,10 @@ PHPAPI double php_get_nan() ((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH; ((php_uint32*)&val)[0] = 0; return val; -#else - /* hope the target platform is ISO-C compliant */ +#elif defined(HAVE_ATOF_ACCEPTS_NAN) return atof("NAN"); +#else + return 0.0/0.0; #endif } @@ -970,9 +971,10 @@ PHPAPI double php_get_inf() ((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH; ((php_uint32*)&val)[0] = 0; return val; -#else - /* hope the target platform is ISO-C compliant */ +#elif defined(HAVE_ATOF_ACCEPTS_INF) return atof("INF"); +#else + return 1.0/0.0; #endif }