aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-06-18 09:08:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-06-18 09:08:10 -0300
commitaf70905246acfad225904b64d027e5b01c7b10eb (patch)
treeb6d62db411706f5317e1269aff90e05399cd51b8 /lauxlib.c
parentb95e46621873cfb460e1d11dcd153914d5d69f86 (diff)
downloadlua-af70905246acfad225904b64d027e5b01c7b10eb.tar.gz
lua-af70905246acfad225904b64d027e5b01c7b10eb.tar.bz2
lua-af70905246acfad225904b64d027e5b01c7b10eb.zip
no need to check whether libraries and host use the same kernel;
Lua should work correctly with several copies of the kernel
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 215a83b1..a8f2cc2e 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.293 2018/02/21 13:48:44 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.294 2018/02/27 18:47:32 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -950,13 +950,11 @@ LUALIB_API lua_State *luaL_newstate (void) {
950 950
951 951
952LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { 952LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) {
953 const lua_Number *v = lua_version(L); 953 lua_Number v = lua_version(L);
954 if (sz != LUAL_NUMSIZES) /* check numeric types */ 954 if (sz != LUAL_NUMSIZES) /* check numeric types */
955 luaL_error(L, "core and library have incompatible numeric types"); 955 luaL_error(L, "core and library have incompatible numeric types");
956 if (v != lua_version(NULL)) 956 else if (v != ver)
957 luaL_error(L, "multiple Lua VMs detected");
958 else if (*v != ver)
959 luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", 957 luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f",
960 (LUAI_UACNUMBER)ver, (LUAI_UACNUMBER)*v); 958 (LUAI_UACNUMBER)ver, (LUAI_UACNUMBER)v);
961} 959}
962 960