diff options
author | Mike Pall <mike> | 2011-01-26 02:31:19 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-01-26 02:31:19 +0100 |
commit | 1b75ec22c86259deaa02644fca5a096b432e145b (patch) | |
tree | 5d9ee055ba559aa0a48fcfe8f8bf1389659f93a9 /src/lj_ccall.c | |
parent | ed6c895ae56288b6982d1651c4ea638452c9e99b (diff) | |
download | luajit-1b75ec22c86259deaa02644fca5a096b432e145b.tar.gz luajit-1b75ec22c86259deaa02644fca5a096b432e145b.tar.bz2 luajit-1b75ec22c86259deaa02644fca5a096b432e145b.zip |
FFI: Add symbol name redirection.
This works like the GCC extension, e.g.:
FILE *fopen(const char *fn, const char *mode) __asm__("" "fopen64");
Diffstat (limited to 'src/lj_ccall.c')
-rw-r--r-- | src/lj_ccall.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lj_ccall.c b/src/lj_ccall.c index 6234a05a..3881ad50 100644 --- a/src/lj_ccall.c +++ b/src/lj_ccall.c | |||
@@ -275,8 +275,16 @@ static int ccall_set_args(lua_State *L, CTState *cts, CType *ct, | |||
275 | #endif | 275 | #endif |
276 | } | 276 | } |
277 | 277 | ||
278 | /* Skip initial attributes. */ | ||
279 | fid = ct->sib; | ||
280 | while (fid) { | ||
281 | CType *ctf = ctype_get(cts, fid); | ||
282 | if (!ctype_isattrib(ctf->info)) break; | ||
283 | fid = ctf->sib; | ||
284 | } | ||
285 | |||
278 | /* Walk through all passed arguments. */ | 286 | /* Walk through all passed arguments. */ |
279 | for (fid = ct->sib, o = L->base+1; o < top; o++) { | 287 | for (o = L->base+1; o < top; o++) { |
280 | CTypeID did; | 288 | CTypeID did; |
281 | CType *d; | 289 | CType *d; |
282 | CTSize sz; | 290 | CTSize sz; |