Allow parsing bcsave.lua (-b option) without FFI.

This commit is contained in:
Mike Pall 2012-06-12 21:25:19 +02:00
parent 0b3d8375f7
commit 80ff9d69a3

View File

@ -212,7 +212,8 @@ typedef struct {
f32 = bit.bswap
function f16(x) return bit.rshift(bit.bswap(x), 16) end
if is64 then
function fofs(x) return bit.bswap(x)*(2ll^32) end
local two32 = ffi.cast("int64_t", 2^32)
function fofs(x) return bit.bswap(x)*two32 end
else
fofs = f32
end