aboutsummaryrefslogtreecommitdiffstats
path: root/lua/inet/core.lua
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-07-28 21:28:21 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-07-28 21:28:21 +0000
commit9c31bbc8cfd2ea8cfe2740c47c045e1773725315 (patch)
treed6616b441ac1fdcb4785b1dc727bf1e3f105baf9 /lua/inet/core.lua
parentde97a7a8473f68eff527c1ec6fb2482ba3d31523 (diff)
downloadlua-inet-9c31bbc8cfd2ea8cfe2740c47c045e1773725315.tar.gz
lua-inet-9c31bbc8cfd2ea8cfe2740c47c045e1773725315.tar.xz
lua-inet-9c31bbc8cfd2ea8cfe2740c47c045e1773725315.zip
add support for lua 5.4 alpha
Signed-off-by: Asbjørn Sloth Tønnesen <ast@2e8.dk>
Diffstat (limited to 'lua/inet/core.lua')
-rw-r--r--lua/inet/core.lua19
1 files changed, 11 insertions, 8 deletions
diff --git a/lua/inet/core.lua b/lua/inet/core.lua
index 15dd0f9..7037885 100644
--- a/lua/inet/core.lua
+++ b/lua/inet/core.lua
@@ -1,6 +1,5 @@
-local bit32 = require 'bit32'
-
local common = require 'inet.common'
+local bitops = require 'inet.bitops'
local format = string.format
local floor = math.floor
@@ -9,12 +8,16 @@ local max = math.max
local pow = math.pow
local insert = table.insert
-local lshift = bit32.lshift
-local rshift = bit32.rshift
-local band = bit32.band
-local extract = bit32.extract
-local replace = bit32.replace
-local bxor = bit32.bxor
+local lshift = bitops.lshift
+local rshift = bitops.rshift
+local band = bitops.band
+local extract = bitops.extract
+local replace = bitops.replace
+local bxor = bitops.bxor
+
+if not pow then
+ function pow(x, y) return x ^ y end
+end
local get_mt = common.get_mt