summaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-02-18 14:20:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-02-18 14:20:56 -0300
commitd2ebdc045bae7c8ed0e62729ca455444c076b1bb (patch)
tree3237f58be972a4e328380e6ec1f96bbf1b8b70d4 /lauxlib.c
parent81ede6bfcedb9304974110e00a2a4ba301afb4f7 (diff)
downloadlua-d2ebdc045bae7c8ed0e62729ca455444c076b1bb.tar.gz
lua-d2ebdc045bae7c8ed0e62729ca455444c076b1bb.tar.bz2
lua-d2ebdc045bae7c8ed0e62729ca455444c076b1bb.zip
new macro 'lua_checkversion' to check whether core and application are
compatible
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 55ee1411..469553ae 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.180 2009/02/13 19:39:34 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.181 2009/02/17 14:31:16 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*/
@@ -585,6 +585,7 @@ static int libsize (const luaL_Reg *l) {
585 585
586LUALIB_API void luaL_register (lua_State *L, const char *libname, 586LUALIB_API void luaL_register (lua_State *L, const char *libname,
587 const luaL_Reg *l) { 587 const luaL_Reg *l) {
588 lua_checkversion(L);
588 if (libname) { 589 if (libname) {
589 /* check whether lib already exists */ 590 /* check whether lib already exists */
590 luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); 591 luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1);