Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/facebook/luaffifb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ffi.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffi.c')
-rw-r--r--ffi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ffi.c b/ffi.c
index 5890c47..eec24a0 100644
--- a/ffi.c
+++ b/ffi.c
@@ -110,8 +110,13 @@ static void* userdata_toptr(lua_State* L, int idx)
lua_pop(L, 2);
if (isfile) {
+#if LUA_VERSION_NUM == 501
+ FILE** stream = (FILE**) ptr;
+ return *stream;
+#else
luaL_Stream* stream = (luaL_Stream*) ptr;
return stream->f;
+#endif
}
return ptr;