From 4f855044c7df79185fb0670be05fdded6297cf3d Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 28 Mar 2004 21:46:43 +0000 Subject: [PATCH] Improve portability (idea by Ard) --- ext/standard/basic_functions.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 } -- 2.50.1