diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-05-28 16:57:42 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:20:58 +0900 |
| commit | fa6a9f6f13e4d47808dee7cb991995284411892b (patch) | |
| tree | 83883d5e6648708a565cfbb419fe5941cef02a77 /src/variable.c | |
| parent | 00f5ddc9aeeab49d656044d14a03765bd6fdfc53 (diff) | |
| download | mruby-fa6a9f6f13e4d47808dee7cb991995284411892b.tar.gz mruby-fa6a9f6f13e4d47808dee7cb991995284411892b.zip | |
Add functions that take symbols as arguments.
- :
Diffstat (limited to 'src/variable.c')
| -rw-r--r-- | src/variable.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/variable.c b/src/variable.c index add1155c8..8fcbd6427 100644 --- a/src/variable.c +++ b/src/variable.c @@ -873,6 +873,12 @@ mrb_const_remove(mrb_state *mrb, mrb_value mod, mrb_sym sym) } MRB_API void +mrb_define_const_id(mrb_state *mrb, struct RClass *mod, mrb_sym name, mrb_value v) +{ + mrb_obj_iv_set(mrb, (struct RObject*)mod, name, v); +} + +MRB_API void mrb_define_const(mrb_state *mrb, struct RClass *mod, const char *name, mrb_value v) { mrb_obj_iv_set(mrb, (struct RObject*)mod, mrb_intern_cstr(mrb, name), v); |
