]> granicus.if.org Git - php/commitdiff
Make the "rounding fuzz" check work again with gcc 3.3 and later,
authorJoe Orton <jorton@php.net>
Tue, 9 Nov 2004 15:58:16 +0000 (15:58 +0000)
committerJoe Orton <jorton@php.net>
Tue, 9 Nov 2004 15:58:16 +0000 (15:58 +0000)
fixing the bug24142 test.

ext/standard/config.m4

index 97754707811c0d9e4883c450b3d70a8a4836554e..40f35532a52972b01db3f1af06b3c452d612ad00 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id$ -*- sh -*-
+dnl $Id$ -*- autoconf -*-
 
 divert(3)dnl
 
@@ -275,8 +275,12 @@ dnl
 AC_MSG_CHECKING([whether rounding works as expected])
 AC_TRY_RUN([
 #include <math.h>
+  /* keep this out-of-line to prevent use of gcc inline floor() */
+  double somefn(double n) {
+    return floor(n*pow(10,2) + 0.5);
+  }
   int main() {
-    return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5;
+    return somefn(0.045)/10.0 != 0.5;
   }
 ],[
   PHP_ROUND_FUZZ=0.5