diff options
| author | ruki <[email protected]> | 2025-09-04 23:18:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-04 22:30:35 +0800 |
| commit | 6b7638a37f0fb73b021d6f04ac51479ab02ce1cd (patch) | |
| tree | 21abb205e370e1a763e711482028f272a435a9e9 /xmake/core/base/libc.lua | |
| parent | 8ffee17dab287bccd050622bfd62b1cac53c8fcd (diff) | |
fix native thread for luajit
Diffstat (limited to 'xmake/core/base/libc.lua')
| -rw-r--r-- | xmake/core/base/libc.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/core/base/libc.lua b/xmake/core/base/libc.lua index 141bd4f64..f9a12931e 100644 --- a/xmake/core/base/libc.lua +++ b/xmake/core/base/libc.lua @@ -121,8 +121,9 @@ function libc.setbyte(data, offset, value) end function libc.dataptr(data, opt) - if ffi then - if opt and opt.gc then + opt = opt or {} + if ffi and opt.ffi ~= false then + if opt.gc then return ffi.gc(ffi.cast("unsigned char*", data), ffi.C.free) else return ffi.cast("unsigned char*", data) @@ -132,8 +133,9 @@ function libc.dataptr(data, opt) end end -function libc.ptraddr(data) - if ffi then +function libc.ptraddr(data, opt) + opt = opt or {} + if ffi and opt.ffi ~= false then return tonumber(ffi.cast('unsigned long long', data)) else return data |
