mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
class.c: auto-set MRB_MT_FUNC in MRB_MT_ENTRY macro
Since ROM table entries are always C functions, have the MRB_MT_ENTRY() macro set MRB_MT_FUNC automatically. This simplifies entry definitions across all 32 source files. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -55,9 +55,9 @@ typedef struct mrb_mt_tbl {
|
||||
#define MRB_MT_PUBLIC 0 /* MRB_METHOD_PUBLIC_FL */
|
||||
#define MRB_MT_PRIVATE 1 /* MRB_METHOD_PRIVATE_FL */
|
||||
|
||||
/* ROM table entry: { {.func=fn}, sym, flags } */
|
||||
/* ROM table entry: MRB_MT_FUNC is set automatically */
|
||||
#define MRB_MT_ENTRY(fn, sym, flags) \
|
||||
{ { .func = (fn) }, (sym), (flags) }
|
||||
{ { .func = (fn) }, (sym), (flags) | MRB_MT_FUNC }
|
||||
|
||||
/* ROM table initializer from const entries array (auto-computes size).
|
||||
Casts away const because mrb_mt_tbl.ptr is shared with mutable layers;
|
||||
|
||||
Reference in New Issue
Block a user