diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 12:21:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 12:21:09 +0000 |
commit | d986500059e8cacbe179a883d114b29787ca6628 (patch) | |
tree | 4b48e5d2be77c34a3ab8367b8e9f482a422bd5b8 /include/ruby | |
parent | f777225e09bcee89197f3a69739103f230881e27 (diff) | |
download | ruby-d986500059e8cacbe179a883d114b29787ca6628.tar.gz |
* include/ruby/win32.h (frexp, modf): wrongly declared as pure in
mingw math.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-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 cafd7de85f..22c35e6a95 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -692,6 +692,20 @@ uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc #pragma GCC visibility pop #endif +#ifdef __MINGW_ATTRIB_PURE +/* get rid of bugs in math.h of mingw */ +#define frexp(_X, _Y) __extension__ ({\ + int *intptr_frexp_bug = (_Y);\ + *intptr_frexp_bug = *intptr_frexp_bug;\ + frexp((_X), intptr_frexp_bug);\ +}) +#define modf(_X, _Y) __extension__ ({\ + double *intptr_modf_bug = (_Y);\ + *intptr_modf_bug = *intptr_modf_bug;\ + modf((_X), intptr_modf_bug);\ +}) +#endif + #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */ |