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

index 28a26b5948a3d0d26b2b677d78267aec4baa0229..6cb1a6f4226d7d92ee4944c9c100b1ac5d243461 100644 (file)
@@ -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
 }