From eda6c1dc0550249b6e2d92c60aaa683d2b154eaf Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 8 Dec 2016 15:38:19 +0900 Subject: fix build on vs2013-vs2015 --- src/numeric.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/numeric.c b/src/numeric.c index 25a411de8..a9a2a641b 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -357,7 +357,11 @@ flo_shift(mrb_state *mrb, mrb_value x, mrb_int width) while (width++) { val /= 2; } +#if defined(_ISOC99_SOURCE) val = trunc(val); +#else + val = val > 0 ? floor(val) : ceil(val); +#endif if (val == 0 && mrb_float(x) < 0) { return mrb_fixnum_value(-1); } -- cgit v1.2.3 From c27dbfedf4dbd95ef17c6ad2b84933088e56d2cd Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 8 Dec 2016 15:56:50 +0900 Subject: disable define const on VS --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/string.c b/src/string.c index a9351619b..c921ca56d 100644 --- a/src/string.c +++ b/src/string.c @@ -2773,7 +2773,7 @@ mrb_init_string(mrb_state *mrb) #ifndef __STDC__ # ifdef __GNUC__ # define const __const__ -# else +# elif !defined(_MSC_VER) # define const # endif #endif -- cgit v1.2.3