aboutsummaryrefslogtreecommitdiffstats
path: root/missing
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 13:35:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 13:35:13 +0000
commitbfb8b125faa32e908c474dece5e3d83a4424d209 (patch)
tree7ea4df28f5c7abb36e233f3c5728284d32a6837a /missing
parentd2dd7416faf3d00c641d18a26ee67f25c9b26f5a (diff)
downloadruby-bfb8b125faa32e908c474dece5e3d83a4424d209.tar.gz
* missing/lgamma_r.c (lgamma_r): get rid of false warning on mingw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/lgamma_r.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c
index 64ca829f10..6d2f38f40c 100644
--- a/missing/lgamma_r.c
+++ b/missing/lgamma_r.c
@@ -47,6 +47,17 @@ loggamma(double x) /* the natural logarithm of the Gamma function. */
+ 0.5 * LOG_2PI - log(v) - x + (x - 0.5) * log(x);
}
+
+#ifdef __MINGW_ATTRIB_PURE
+/* get rid of bugs in math.h of mingw */
+#define modf(_X, _Y) __extension__ ({\
+ double intpart_modf_bug = intpart_modf_bug;\
+ double result_modf_bug = modf((_X), &intpart_modf_bug);\
+ *(_Y) = intpart_modf_bug;\
+ result_modf_bug;\
+})
+#endif
+
/* the natural logarithm of the absolute value of the Gamma function */
double
lgamma_r(double x, int *signp)