[前][次][番号順一覧][スレッド一覧]

ruby-changes:24471

From: shirosaki <ko1@a...>
Date: Wed, 25 Jul 2012 00:12:37 +0900 (JST)
Subject: [ruby-changes:24471] shirosaki:r36522 (trunk): Fix broken pow() on x64-mingw32

shirosaki	2012-07-25 00:12:26 +0900 (Wed, 25 Jul 2012)

  New Revision: 36522

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36522

  Log:
    Fix broken pow() on x64-mingw32
    
    * include/ruby/win32.h (rb_w32_pow): add new function.
      We use powl() instead of broken pow() for x64-mingw32. This workaround
      fixes test failures related to floating point numeric.
      [ruby-core:46686] [Bug #6784]

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/win32.h

Index: include/ruby/win32.h
===================================================================
--- include/ruby/win32.h	(revision 36521)
+++ include/ruby/win32.h	(revision 36522)
@@ -764,4 +764,18 @@
 }  /* extern "C" { */
 #endif
 
+#ifdef __MINGW64__
+/*
+ * Use powl() instead of broken pow() of x86_64-w64-mingw32.
+ * This workaround will fix test failures in test_bignum.rb,
+ * test_fixnum.rb and test_float.rb etc.
+ */
+static inline double
+rb_w32_pow(double x, double y)
+{
+    return powl(x, y);
+}
+#define pow rb_w32_pow
+#endif
+
 #endif /* RUBY_WIN32_H */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 36521)
+++ ChangeLog	(revision 36522)
@@ -1,3 +1,10 @@
+Tue Jul 24 23:34:43 2012  Hiroshi Shirosaki  <h.shirosaki@g...>
+
+	* include/ruby/win32.h (rb_w32_pow): add new function.
+	  We use powl() instead of broken pow() for x64-mingw32. This workaround
+	  fixes test failures related to floating point numeric.
+	  [ruby-core:46686] [Bug #6784]
+
 Tue Jul 24 15:01:24 2012  NAKAMURA Usaku  <usa@r...>
 
 	* win32/win32.c (rb_w32_socket, rb_w32_socketpair): remember the family

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]