From a4243360a2f8248dbf23b46ca14a7a59c0479b32 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Sat, 3 Aug 2019 11:54:45 +0900 Subject: Fix `mrb_vformat("%f")` with `MRB_USE_FLOAT` It potentially not work when `mrb_float` is `float` because `float` variable in variable length arguments is promoted to `double`. Also I fixed build with `MRB_WITHOUT_FLOAT`. --- mrbgems/mruby-test/vformat.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mrbgems/mruby-test') diff --git a/mrbgems/mruby-test/vformat.c b/mrbgems/mruby-test/vformat.c index e6581d6be..e02383f77 100644 --- a/mrbgems/mruby-test/vformat.c +++ b/mrbgems/mruby-test/vformat.c @@ -4,6 +4,11 @@ #include #include +#ifdef MRB_WITHOUT_FLOAT +typedef mrb_int mrb_float; +#define mrb_float(o) mrb_fixnum(o) +#endif + #define NATIVE_TYPES \ char c; \ int d; \ -- cgit v1.2.3