summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--require.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/require.lua b/require.lua
index 99d66b0..7e49e3f 100644
--- a/require.lua
+++ b/require.lua
@@ -1,3 +1,5 @@
1local ffi = require and require("ffi") or ffi
2
1ffi.cdef [[ 3ffi.cdef [[
2 void *fopen (const char *fname, const char *mode); 4 void *fopen (const char *fname, const char *mode);
3 int fseek (void *f, long offset, int origin); 5 int fseek (void *f, long offset, int origin);
@@ -13,7 +15,7 @@ ffi.cdef [[
13 15
14local C = ffi.C 16local C = ffi.C
15 17
16local loaded = { ["ffi"] = require and require("ffi") or ffi } 18local loaded = { ["ffi"] = ffi }
17local loader = function(modname) 19local loader = function(modname)
18 local fname = ffi.new("char[?]", #modname + 5, modname) 20 local fname = ffi.new("char[?]", #modname + 5, modname)
19 local p = C.strchr(fname, 46) 21 local p = C.strchr(fname, 46)