FFI: Add symbol name redirection.

This works like the GCC extension, e.g.:
FILE *fopen(const char *fn, const char *mode) __asm__("" "fopen64");
This commit is contained in:
Mike Pall
2011-01-26 02:31:19 +01:00
parent ed6c895ae5
commit 1b75ec22c8
4 changed files with 58 additions and 21 deletions

View File

@@ -275,8 +275,16 @@ static int ccall_set_args(lua_State *L, CTState *cts, CType *ct,
#endif
}
/* Skip initial attributes. */
fid = ct->sib;
while (fid) {
CType *ctf = ctype_get(cts, fid);
if (!ctype_isattrib(ctf->info)) break;
fid = ctf->sib;
}
/* Walk through all passed arguments. */
for (fid = ct->sib, o = L->base+1; o < top; o++) {
for (o = L->base+1; o < top; o++) {
CTypeID did;
CType *d;
CTSize sz;