| 942 | |
| 943 | |
| 944 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { |
| 945 | const lua_Number *v = lua_version(L); |
| 946 | if (v != lua_version(NULL)) |
| 947 | luaL_error(L, "multiple Lua VMs detected"); |
| 948 | else if (*v != ver) |
| 949 | luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", |
| 950 | ver, *v); |
| 951 | /* check conversions number -> integer types */ |
| 952 | lua_pushnumber(L, -(lua_Number)0x1234); |
| 953 | if (lua_tointeger(L, -1) != -0x1234 || |
| 954 | lua_tounsigned(L, -1) != (lua_Unsigned)-0x1234) |
| 955 | luaL_error(L, "bad conversion number->int;" |
| 956 | " must recompile Lua with proper settings"); |
| 957 | lua_pop(L, 1); |
| 958 | } |
| 959 |
nothing calls this directly
no test coverage detected