summaryrefslogtreecommitdiff
path: root/test/other/ver.lua
blob: 83abcb26a60175c22abd0d77eb996f1241243635 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local platform = require 'bee.platform'

assert(_VERSION == 'Lua 5.4', '必须是 Lua 5.4')

local arch = (function()
    if string.packsize then
        local size = string.packsize "T"
        if size == 8 then
            return 64
        end
        if size == 4 then
            return 32
        end
    else
        if platform ~= "windows" then
            return 64
        end
        local size = #tostring(io.stderr)
        if size <= 15 then
            return 32
        end
        return 64
    end
    assert(false, "unknown arch")
end)()

assert(arch == 64, '必须是 x84_64')