From d02be97f167a1295d88f62966c19067173028a1d Mon Sep 17 00:00:00 2001 From: Alexey Romanoff Date: Mon, 25 Apr 2022 13:46:49 +0300 Subject: [PATCH] src/websocket/bit.lua: add support for bitop-lua --- src/websocket/bit.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/websocket/bit.lua b/src/websocket/bit.lua index f8fc685..7a65993 100644 --- a/src/websocket/bit.lua +++ b/src/websocket/bit.lua @@ -4,7 +4,13 @@ if has_bit32 then bit.rol = bit.lrotate bit.ror = bit.rrotate return bit -else +end + +local has_bit +has_bit, bit = pcall(require,'bit') +if has_bit then -- luajit / lua 5.1 + luabitop return require'bit' end + +return (require 'bitop.funcs').bit