changed FFI>>call:signature:arguments: to return a value

This commit is contained in:
hyunghwan.chung 2019-04-07 17:54:44 +00:00
parent a6f7f85658
commit 90d665781c
2 changed files with 4 additions and 0 deletions

View File

@ -65,5 +65,7 @@ class FFI(Object)
rc := self.ffi call(f, sig, args).
if (rc isError) { FFIException signal: ('Unable to call %s' strfmt(name)) }.
^rc.
}
}

View File

@ -216,6 +216,7 @@ static moo_pfrc_t pf_call (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs)
i++;
}
/* check argument signature */
for (j = 0; i < MOO_OBJ_GET_SIZE(sig); i++)
{
moo_ooch_t fmtc;
@ -344,6 +345,7 @@ static moo_pfrc_t pf_call (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs)
if (i >= MOO_OBJ_GET_SIZE(sig)) goto call_void;
/* check the return value type in signature */
switch (MOO_OBJ_GET_CHAR_VAL(sig, i))
{
/* TODO: support more types... */