File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11local fs = {}
2- local ffi = require (" ffi" )
32
4- if ffi .arch ~= " Windows" then
3+ if not jit then
4+ elseif jit .arch ~= " Windows" then
5+ local ffi = require (" ffi" )
56 ffi .cdef (" char *strerror(int);" )
67
78 function fs .last_error ()
@@ -10,6 +11,8 @@ if ffi.arch ~= "Windows" then
1011 return err == " " and tostring (num ) or err
1112 end
1213else
14+ local ffi = require (" ffi" )
15+
1316 ffi .cdef (" uint32_t GetLastError();" )
1417 ffi .cdef [[
1518 uint32_t FormatMessageA (
3841 end
3942end
4043
41- if ffi .arch ~= " Windows" then
44+ if not jit then
45+ elseif jit .arch ~= " Windows" then
46+ local ffi = require (" ffi" )
47+
4248 do -- attributes
4349 local stat_struct
4450
@@ -353,6 +359,8 @@ if ffi.arch ~= "Windows" then
353359 end
354360 end
355361else
362+ local ffi = require (" ffi" )
363+
356364 local DIRECTORY = 0x10
357365 local time_struct = ffi .typeof ([[
358366 struct {
459467
460468 local ffi_cast = ffi .cast
461469 local ffi_string = ffi .string
462- local INVALID_FILE = ffi .cast (" void *" , 0xffffffffffffffff ULL )
470+ local INVALID_FILE = ffi .cast (" void *" , - 1 )
463471 local data_box = ffi .typeof (" $[1]" , find_data_struct )
464472 local data = data_box ()
465473
Original file line number Diff line number Diff line change 7272
7373local ok , fs = pcall (require , " nattlua.other.fs" )
7474
75- if ok then exists = function (path )
75+ if ok and fs . get_type then exists = function (path )
7676 return fs .get_type (path ) == " file"
7777end end
7878
You can’t perform that action at this time.
0 commit comments