Skip to content

Commit 89daaa7

Browse files
committed
fix: openBit32 == openBit is only defined for some versions
1 parent 70bd3c6 commit 89daaa7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/lib.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4415,18 +4415,20 @@ pub const Lua = opaque {
44154415

44164416
/// Open the bit32 standard library
44174417
///
4418+
/// Only available in Lua 5.2 (and deprecated in Lua 5.3) and LuaJIT
4419+
///
44184420
/// * Pops: `0`
44194421
/// * Pushes: `0`
44204422
/// * Errors: `other`
44214423
pub fn openBit32(lua: *Lua) void {
44224424
switch (lang) {
4423-
.lua52 => lua.requireF(c.LUA_BITLIBNAME, c.luaopen_bit32, true),
4425+
.lua52, .lua53 => lua.requireF(c.LUA_BITLIBNAME, c.luaopen_bit32, true),
44244426
.luajit => lua.requireF(c.LUA_BITLIBNAME, c.luaopen_bit, true),
4425-
else => return,
4427+
else => @compileError(@src().fn_name ++ " is only available in Lua 5.2 and LuaJIT."),
44264428
}
4427-
44284429
lua.pop(1);
44294430
}
4431+
pub const openBit = openBit32;
44304432

44314433
/// Open the vector standard library
44324434
///

0 commit comments

Comments
 (0)