Merge pull request #3335 from mattn/fix-vs2013

fix build on vs2013-vs2015
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-12-08 16:48:08 +09:00
committed by GitHub
3 changed files with 6 additions and 1 deletions
+1
View File
@@ -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);
+4
View File
@@ -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);
}
+1 -1
View File
@@ -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