diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-01-03 11:29:10 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-01-03 11:29:10 +0900 |
| commit | f9d89e3fa592706de6a6dee701af3961df914292 (patch) | |
| tree | 389ba44446a6a8289f52b978221825ea0f14b02c | |
| parent | 3e59f25eef8faf2677071dfc1add7142e92549e7 (diff) | |
| download | mruby-f9d89e3fa592706de6a6dee701af3961df914292.tar.gz mruby-f9d89e3fa592706de6a6dee701af3961df914292.zip | |
`mruby-inline-struct` to support `MRB_WITHOUT_FLOAT`.
| -rw-r--r-- | mrbgems/mruby-inline-struct/test/inline.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mrbgems/mruby-inline-struct/test/inline.c b/mrbgems/mruby-inline-struct/test/inline.c index 91c767f30..51804ae31 100644 --- a/mrbgems/mruby-inline-struct/test/inline.c +++ b/mrbgems/mruby-inline-struct/test/inline.c @@ -11,12 +11,14 @@ istruct_test_initialize(mrb_state *mrb, mrb_value self) mrb_value object; mrb_get_args(mrb, "o", &object); - if (mrb_float_p(object)) { - strncpy(string, "float", size-1); - } - else if (mrb_fixnum_p(object)) { + if (mrb_fixnum_p(object)) { strncpy(string, "fixnum", size-1); } +#ifndef MRB_WITHOUT_FLOAT + else if (mrb_float_p(object)) { + strncpy(string, "float", size-1); + } +#endif else if (mrb_string_p(object)) { strncpy(string, "string", size-1); } |
