Skip to content

Commit

Permalink
feat: support lua 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joway committed Jan 10, 2025
1 parent f616652 commit bf2f765
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions wireshark/thrift.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,32 @@
-- limitations under the License.

-------------------------------------------------------------------------------
--- utils
bit32 = {}
function bit32.band(a, b)
return a & b
end
function bit32.bor(a, b)
return a | b
end
function bit32.bxor(a, b)
return a ~ b
end
function bit32.lshift(a, n)
return a << n
end
function bit32.rshift(a, n)
return a >> n
end
function bit32.btest(...)
local args = {...}
local result = args[1]
for i = 2, #args do
result = result & args[i]
end
return result ~= 0
end

--- protocols
local ttheader_protocol = Proto("ttheader", "Thrift TTHeader Protocol")
local tbinary_protocol = Proto("tbinary", "Thrift UnframedBinary Protocol")
Expand Down

0 comments on commit bf2f765

Please sign in to comment.