diff options
| author | dearblue <[email protected]> | 2021-12-31 19:12:11 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2021-12-31 19:12:11 +0900 |
| commit | ac22a63ae3c29ac3921f53ac63ae981ab0def744 (patch) | |
| tree | 7dd90c5218796c16977c7dfbaa3fb8e8f05905fb /mrbgems/mruby-bin-mrbc | |
| parent | 5ca17c2dce47c637728ed03661465d0ada0a61a9 (diff) | |
| download | mruby-ac22a63ae3c29ac3921f53ac63ae981ab0def744.tar.gz mruby-ac22a63ae3c29ac3921f53ac63ae981ab0def744.zip | |
Call functions directly from `mrb_ensure_float_type()`
ref. commit 7f40b645d2773c8f50c48ae4adf90488e164da55
Currently, the build configurations `MRB_USE_COMPLEX` and `MRB_USE_RATIONAL` are not listed in the documentation.
In other words, they are hidden settings.
They are defined in `mrbgems/mruby-{complex,rational}/mrbgem.rake`.
So this patch assumes that it is safe to refer to these functions in core-gems directly from core functions.
However, applications that link with `libmruby_core.a` will have compatibility issues.
In fact, `mrbgems/mruby-bin-mrbc` links with `libmruby_core.a`, so I had to prepare a dummy function.
Diffstat (limited to 'mrbgems/mruby-bin-mrbc')
| -rw-r--r-- | mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c b/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c index 8b0b6dc57..c3e37e0a6 100644 --- a/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +++ b/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c @@ -366,3 +366,18 @@ mrb_final_mrbgems(mrb_state *mrb) { } #endif + +#ifdef MRB_USE_COMPLEX +mrb_value mrb_complex_to_f(mrb_state *mrb, mrb_value comp) +{ + mrb_raise(mrb, E_NOTIMP_ERROR, "unavailable for core only"); +} +#endif + +#ifdef MRB_USE_RATIONAL +mrb_value +mrb_rational_to_f(mrb_state *mrb, mrb_value rat) +{ + mrb_raise(mrb, E_NOTIMP_ERROR, "unavailable for core only"); +} +#endif |
