summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-complex/src/complex.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-07-24 10:43:24 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-07-24 10:48:00 +0900
commita57a9bce79b7512f1e0e08149c0a328a993b3e1b (patch)
tree8a12990e9db4cfd8f4f2b2cc8bbae4d960227fd3 /mrbgems/mruby-complex/src/complex.c
parente968bdf6298e6f2e567e414862792d5ad7aff4ad (diff)
downloadmruby-a57a9bce79b7512f1e0e08149c0a328a993b3e1b.tar.gz
mruby-a57a9bce79b7512f1e0e08149c0a328a993b3e1b.zip
Call `MRB_SET_INSTANCE_TT` for `Complex` and `Rational`.
Diffstat (limited to 'mrbgems/mruby-complex/src/complex.c')
-rw-r--r--mrbgems/mruby-complex/src/complex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mrbgems/mruby-complex/src/complex.c b/mrbgems/mruby-complex/src/complex.c
index d6414a5e1..aa2afc2ce 100644
--- a/mrbgems/mruby-complex/src/complex.c
+++ b/mrbgems/mruby-complex/src/complex.c
@@ -132,7 +132,11 @@ void mrb_mruby_complex_gem_init(mrb_state *mrb)
mrb_assert(sizeof(struct mrb_complex) < ISTRUCT_DATA_SIZE);
#endif
comp = mrb_define_class(mrb, "Complex", mrb_class_get(mrb, "Numeric"));
- //MRB_SET_INSTANCE_TT(comp, MRB_TT_ISTRUCT);
+#ifdef COMPLEX_USE_ISTRUCT
+ MRB_SET_INSTANCE_TT(comp, MRB_TT_ISTRUCT);
+#else
+ MRB_SET_INSTANCE_TT(comp, MRB_TT_DATA);
+#endif
mrb_undef_class_method(mrb, comp, "new");
mrb_define_class_method(mrb, comp, "rectangular", complex_s_rect, MRB_ARGS_REQ(1)|MRB_ARGS_OPT(1));
mrb_define_class_method(mrb, comp, "rect", complex_s_rect, MRB_ARGS_REQ(1)|MRB_ARGS_OPT(1));