MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaL_checkversion_

Function luaL_checkversion_

third-party/lua-5.2.4/src/lauxlib.c:944–958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942
943
944LUALIB_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

Callers

nothing calls this directly

Calls 4

lua_versionFunction · 0.70
luaL_errorFunction · 0.70
lua_pushnumberFunction · 0.70
lua_tointegerFunction · 0.50

Tested by

no test coverage detected