Skip to content
leafi edited this page Nov 14, 2013 · 2 revisions

We (as of writing) use Lua-5.3.0-work1, as Lua 5.3 introduces support for 64-bit integers to the Lua language and work1 is the only version available.

In this version LUA_INTEGER and LUA_UNSIGNED are of type 'long long' and 'unsigned long long' respectively -- which are 64-bit and equal to the types 'long' and 'unsigned long' we use for the main kernel code. So that's okay.

'bit32' is the Lua library used for bitwise ops.

At least in Lua-5.3.0-work1 lbitlib.c (the implementation for bit32) has #define LUA_NBITS 32, whereas we need #define LUA_NBITS 64. Oddly I swear the rest of the code seems to be fine for working with new Lua integers, that's all that needs changing.

All the Lua code in the project refers to bit64 not bit32. The minimal changes were made to Lua-5.3.0-work1 to make the library be called bit64 and not bit32; this is done so if you try to compile against a vanilla Lua-5.3.0-work1 you get the idea that something needs to be changed.

Clone this wiki locally