add missing pic_apply_argv definition

This commit is contained in:
Yuichi Nishiwaki 2013-11-09 14:13:14 +09:00
parent 0d28f246de
commit e373aa7b92
1 changed files with 17 additions and 0 deletions

View File

@ -228,6 +228,23 @@ pic_get_args(pic_state *pic, const char *format, ...)
return i;
}
pic_value
pic_apply_argv(pic_state *pic, struct pic_proc *proc, size_t argc, ...)
{
va_list ap;
pic_value v;
va_start(ap, argc);
v = pic_nil_value();
while (argc--) {
v = pic_cons(pic, va_arg(ap, pic_value), v);
}
va_end(ap);
return pic_apply(pic, proc, v);
}
#if VM_DEBUG
# define OPCODE_EXEC_HOOK printf("OP = %d\n", c.insn)
#else