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