MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaL_checkversion_

Function luaL_checkversion_

freebsd/contrib/openzfs/module/lua/lauxlib.c:775–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773
774
775LUALIB_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

Callers

nothing calls this directly

Calls 4

lua_versionFunction · 0.85
lua_tointegerFunction · 0.85
luaL_errorFunction · 0.70
lua_pushnumberFunction · 0.70

Tested by

no test coverage detected