FFI: Convert io.* file handle to FILE * pointer (but as a void *).

This commit is contained in:
Mike Pall
2012-05-29 12:08:21 +02:00
parent 97b7edb206
commit fa2572da6c
3 changed files with 24 additions and 12 deletions

View File

@@ -603,7 +603,10 @@ void lj_cconv_ct_tv(CTState *cts, CType *d,
tmpptr = (void *)0;
flags |= CCF_FROMTV;
} else if (tvisudata(o)) {
tmpptr = uddata(udataV(o));
GCudata *ud = udataV(o);
tmpptr = uddata(ud);
if (ud->udtype == UDTYPE_IO_FILE)
tmpptr = *(void **)tmpptr;
} else if (tvislightud(o)) {
tmpptr = lightudV(o);
} else if (tvisfunc(o)) {