Permalink
Browse files

fix build on vs2013-vs2015

  • Loading branch information...
mattn committed Dec 8, 2016
1 parent 0d38ede commit eda6c1dc0550249b6e2d92c60aaa683d2b154eaf
Showing with 5 additions and 0 deletions.
  1. +1 −0 include/mruby/compile.h
  2. +4 −0 src/numeric.c
View
@@ -163,6 +163,7 @@ struct mrb_parser_state {
MRB_API struct mrb_parser_state* mrb_parser_new(mrb_state*);
MRB_API void mrb_parser_free(struct mrb_parser_state*);
MRB_API void mrb_parser_parse(struct mrb_parser_state*,mrbc_context*);
MRB_API double mrb_float_read(const char*, char**);
MRB_API void mrb_parser_set_filename(struct mrb_parser_state*, char const*);
MRB_API char const* mrb_parser_get_filename(struct mrb_parser_state*, uint16_t idx);
View
@@ -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);
}

0 comments on commit eda6c1d

Please sign in to comment.