Files
Yukihiro "Matz" Matsumoto d1a48c03e2 gc.c: add mrbc stub for mrb_task_mark_all
added forward declaration in gc.c and stub implementation in mrbc stub.c
for mrb_task_mark_all to avoid link errors when mrbc is built without
mruby-task gem.

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-11 12:41:39 +09:00

105 lines
2.1 KiB
C

#include <mruby.h>
/*
functions defined in mrbgems referenced from the core should be listed here
to avoid link errors, since mrbc does not link any mrbgem ignoring configuration.
*/
#ifdef MRB_USE_COMPLEX
mrb_value mrb_complex_new(mrb_state *mrb, mrb_float x, mrb_float y)
{
return mrb_nil_value();
}
mrb_value mrb_complex_add(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_complex_sub(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_complex_mul(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_complex_div(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_complex_to_i(mrb_state *mrb, mrb_value x)
{
return mrb_nil_value();
}
mrb_value mrb_complex_to_f(mrb_state *mrb, mrb_value x)
{
return mrb_nil_value();
}
void mrb_complex_copy(mrb_state *mrb, mrb_value x, mrb_value y)
{
}
#endif
#ifdef MRB_USE_RATIONAL
mrb_value mrb_rational_new(mrb_state *mrb, mrb_int x, mrb_int y)
{
return mrb_nil_value();
}
mrb_value mrb_rational_add(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_rational_sub(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_rational_mul(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_rational_div(mrb_state *mrb, mrb_value x, mrb_value y)
{
return mrb_nil_value();
}
mrb_value mrb_rational_to_i(mrb_state *mrb, mrb_value x)
{
return mrb_nil_value();
}
mrb_value mrb_rational_to_f(mrb_state *mrb, mrb_value x)
{
return mrb_nil_value();
}
mrb_value
mrb_as_rational(mrb_state *mrb, mrb_value x)
{
return mrb_nil_value();
}
void mrb_rational_copy(mrb_state *mrb, mrb_value x, mrb_value y)
{
}
int mrb_rational_mark(mrb_state *mrb, struct RBasic *x)
{
return 2;
}
#endif
#ifdef MRB_USE_SET
size_t mrb_gc_mark_set(mrb_state *mrb, struct RBasic *obj)
{
/* stub for mrbc */
return 0;
}
void mrb_gc_free_set(mrb_state *mrb, struct RBasic *obj)
{
/* stub for mrbc */
}
#endif
#ifdef MRB_USE_TASK_SCHEDULER
void mrb_task_mark_all(mrb_state *mrb)
{
/* stub for mrbc */
(void)mrb;
}
#endif