diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-24 07:34:51 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-24 07:34:51 +0000 |
commit | 0414c9b901a3764b7cdb549d3273e7e54210c8ff (patch) | |
tree | 8d7fa00ebb22bf05aeed017ff3d5638b96e97dff /include | |
parent | 5841efa380f9fe76b09588fbbc09d17acb0f24ed (diff) |
merge revision(s) 36522: [Backport #7016]
* 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/branches/ruby_1_9_3@37024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/win32.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 99cdea1fc3..99382f48e3 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -756,4 +756,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 */ |