James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 1 | local m = {} |
| 2 | local ok, bit = pcall(require, "bit32") |
| 3 | assert(ok, "The Bit32 library must be installed") |
| 4 | assert(pcall(require, "compat53"), "The Compat 5.3 library must be installed") |
| 5 | |
| 6 | m.GetAlignSize = function(k, size) |
| 7 | return bit.band(bit.bnot(k) + 1,(size - 1)) |
| 8 | end |
| 9 | |
| 10 | if not table.unpack then |
| 11 | table.unpack = unpack |
| 12 | end |
| 13 | |
| 14 | if not table.pack then |
| 15 | table.pack = pack |
| 16 | end |
| 17 | |
| 18 | m.string_pack = string.pack |
| 19 | m.string_unpack = string.unpack |
| 20 | |
| 21 | return m |