FFI: Compile calls to stdcall, fastcall and vararg functions.
This commit is contained in:
@@ -402,7 +402,7 @@ static void ccall_struct_ret(CCallState *cc, int *rcl, uint8_t *dp, CTSize sz)
|
||||
/* -- Common C call handling ---------------------------------------------- */
|
||||
|
||||
/* Infer the destination CTypeID for a vararg argument. */
|
||||
static CTypeID ccall_ctid_vararg(CTState *cts, cTValue *o)
|
||||
CTypeID lj_ccall_ctid_vararg(CTState *cts, cTValue *o)
|
||||
{
|
||||
if (tvisnumber(o)) {
|
||||
return CTID_DOUBLE;
|
||||
@@ -506,7 +506,7 @@ static int ccall_set_args(lua_State *L, CTState *cts, CType *ct,
|
||||
} else {
|
||||
if (!(ct->info & CTF_VARARG))
|
||||
lj_err_caller(L, LJ_ERR_FFI_NUMARG); /* Too many arguments. */
|
||||
did = ccall_ctid_vararg(cts, o); /* Infer vararg type. */
|
||||
did = lj_ccall_ctid_vararg(cts, o); /* Infer vararg type. */
|
||||
isva = 1;
|
||||
}
|
||||
d = ctype_raw(cts, did);
|
||||
|
||||
Reference in New Issue
Block a user