mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fix build on vs2013-vs2015
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user