]> granicus.if.org Git - php/commitdiff
MFH: Improve portability (idea by Ard)
authorMarcus Boerger <helly@php.net>
Sun, 28 Mar 2004 21:50:01 +0000 (21:50 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 28 Mar 2004 21:50:01 +0000 (21:50 +0000)
ext/standard/basic_functions.c

index f1066fc4c640fbfd0989474e193d8537f64d243e..d7c3d48b99d4d715c216bf5d84b2081cca985d14 100644 (file)
@@ -1006,9 +1006,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
 }
 
@@ -1019,9 +1020,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
 }