summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-29 22:50:03 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-29 22:50:03 +0000
commitf13e0ec80e9c98e42db2e0d48978c60c64c7cf6d (patch)
treebc6243487a8843de655a1c0e3eb88fdeb4c42b50 /include/ruby
parent49ed59fdec91bc9315b305d71d14036114ed9bfb (diff)
merges r31278 from trunk into ruby_1_9_2.
-- * include/ruby/win32.h (frexp, modf): wrongly declared as pure in mingw math.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/win32.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 80842c3852..32b61d38da 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -674,6 +674,20 @@ in asynchronous_func_t.
typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc, uintptr_t* argv, uintptr_t intrval);
+#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 */