summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-24 15:12:26 +0000
committershirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-24 15:12:26 +0000
commit4f8b1384df0009675263efeb56cb489b79addb14 (patch)
treee4e4c1924bdba8b95ac4665d60ad8943280e5b0e
parent0daf636e7a3bb46d42c26e90bc863682aff6c96c (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--include/ruby/win32.h14
2 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e1992741f..e782653a3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Jul 24 23:34:43 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * 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@ruby-lang.org>
* win32/win32.c (rb_w32_socket, rb_w32_socketpair): remember the family
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 5ec3d3dd66..7cbdb884df 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -764,4 +764,18 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc
} /* 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 */