summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-inline-struct
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-01-03 11:29:10 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-01-03 11:29:10 +0900
commitf9d89e3fa592706de6a6dee701af3961df914292 (patch)
tree389ba44446a6a8289f52b978221825ea0f14b02c /mrbgems/mruby-inline-struct
parent3e59f25eef8faf2677071dfc1add7142e92549e7 (diff)
downloadmruby-f9d89e3fa592706de6a6dee701af3961df914292.tar.gz
mruby-f9d89e3fa592706de6a6dee701af3961df914292.zip
`mruby-inline-struct` to support `MRB_WITHOUT_FLOAT`.
Diffstat (limited to 'mrbgems/mruby-inline-struct')
-rw-r--r--mrbgems/mruby-inline-struct/test/inline.c10
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);
}