iliaa Sat Aug 9 12:13:48 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/standard math.c config.m4
Log:
MFH: Detection of buggy compiler (gcc)
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.97.2.5 php-src/ext/standard/math.c:1.97.2.6
--- php-src/ext/standard/math.c:1.97.2.5 Fri Aug 8 19:42:10 2003
+++ php-src/ext/standard/math.c Sat Aug 9 12:13:47 2003
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.97.2.5 2003/08/08 23:42:10 iliaa Exp $ */
+/* $Id: math.c,v 1.97.2.6 2003/08/09 16:13:47 iliaa Exp $ */
#include "php.h"
#include "php_math.h"
@@ -32,7 +32,13 @@
#define M_PI 3.14159265358979323846
#endif
-#define PHP_ROUND_FUZZ 0.50000000001
+#ifndef PHP_ROUND_FUZZ
+# ifndef PHP_WIN32
+# define PHP_ROUND_FUZZ 0.50000000001
+# else
+# define PHP_ROUND_FUZZ 0.5
+# endif
+#endif
/* {{{ proto int abs(int number)
Return the absolute value of the number */
Index: php-src/ext/standard/config.m4
diff -u php-src/ext/standard/config.m4:1.47.2.3 php-src/ext/standard/config.m4:1.47.2.4
--- php-src/ext/standard/config.m4:1.47.2.3 Thu Jun 5 00:15:03 2003
+++ php-src/ext/standard/config.m4 Sat Aug 9 12:13:47 2003
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.47.2.3 2003/06/05 04:15:03 sniper Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.47.2.4 2003/08/09 16:13:47 iliaa Exp $ -*- sh -*-
divert(3)dnl
@@ -225,6 +225,27 @@
],[
REGEX_TYPE=php
])
+
+dnl
+dnl round fuzz
+dnl
+AC_MSG_CHECKING([whether rounding works as expected])
+AC_TRY_RUN([
+#include <math.h>
+ int main() {
+ return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5;
+ }
+],[
+ PHP_ROUND_FUZZ=0.5
+ AC_MSG_RESULT(yes)
+],[
+ PHP_ROUND_FUZZ=0.50000000001
+ AC_MSG_RESULT(no)
+],[
+ PHP_ROUND_FUZZ=0.50000000001
+ AC_MSG_RESULT(cross compile)
+])
+AC_DEFINE_UNQUOTED(PHP_ROUND_FUZZ, $PHP_ROUND_FUZZ, [ see #24142 ])
AC_FUNC_FNMATCH
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php