From 06d06b2c9e7c7d3780ec2b9fbb58949403e5790e Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Tue, 24 Jul 2012 07:00:59 +0900 Subject: [PATCH] Fix broken pow() of mingw We will use powl() instead of broken pow(). This workaround will fix failures in test_bignum.rb, test_fixnum.rb and test_float.rb etc. --- include/ruby/win32.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 5ec3d3d..a9986d1 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 +fake_pow(double x, double y) +{ + return powl(x, y); +} +#define pow fake_pow +#endif + #endif /* RUBY_WIN32_H */ -- 1.7.11.msysgit.1