| 773 | |
| 774 | |
| 775 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { |
| 776 | const lua_Number *v = lua_version(L); |
| 777 | if (v != lua_version(NULL)) |
| 778 | luaL_error(L, "multiple Lua VMs detected"); |
| 779 | else if (*v != ver) |
| 780 | luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", |
| 781 | ver, *v); |
| 782 | /* check conversions number -> integer types */ |
| 783 | lua_pushnumber(L, -(lua_Number)0x1234); |
| 784 | if (lua_tointeger(L, -1) != -0x1234 || |
| 785 | lua_tounsigned(L, -1) != (lua_Unsigned)-0x1234) |
| 786 | luaL_error(L, "bad conversion number->int;" |
| 787 | " must recompile Lua with proper settings"); |
| 788 | lua_pop(L, 1); |
| 789 | } |
| 790 | |
| 791 | #if defined(_KERNEL) |
| 792 |
nothing calls this directly
no test coverage detected