diff options
author | Ronan Collobert <ronan@collobert.com> | 2015-05-05 08:05:18 +0300 |
---|---|---|
committer | Ronan Collobert <ronan@collobert.com> | 2015-05-05 08:05:18 +0300 |
commit | 840c06fed03b4e2c7dbad13adaed809bb5b0a610 (patch) | |
tree | 24076a1a5c222cb85fa867da255e378d22098206 /lib | |
parent | 92f9fb48e4ff263b5a4d47c5e63eb2d26c0435c7 (diff) |
fix lua 5.2 support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/init.c | 2 | ||||
-rw-r--r-- | lib/queue.c | 6 | ||||
-rw-r--r-- | lib/threads.c | 6 |
3 files changed, 7 insertions, 7 deletions
@@ -2,7 +2,7 @@ #include <lauxlib.h> #if LUA_VERSION_NUM == 501 -static void luaT_setfuncs(lua_State *L, const luaL_Reg *l, int nup) +static void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup+1, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ diff --git a/lib/queue.c b/lib/queue.c index ef26f42..a25586c 100644 --- a/lib/queue.c +++ b/lib/queue.c @@ -362,16 +362,16 @@ static void queue_init_pkg(lua_State *L) { if(!luaL_newmetatable(L, "threads.Queue")) luaL_error(L, "threads: threads.Queue type already exists"); - luaT_setfuncs(L, queue__, 0); + luaL_setfuncs(L, queue__, 0); lua_pushstring(L, "__get"); lua_newtable(L); - luaT_setfuncs(L, queue_get__, 0); + luaL_setfuncs(L, queue_get__, 0); lua_rawset(L, -3); lua_pushstring(L, "__set"); lua_newtable(L); - luaT_setfuncs(L, queue_set__, 0); + luaL_setfuncs(L, queue_set__, 0); lua_rawset(L, -3); lua_pop(L, 1); diff --git a/lib/threads.c b/lib/threads.c index d9cc2f6..5f379fe 100644 --- a/lib/threads.c +++ b/lib/threads.c @@ -226,7 +226,7 @@ static void thread_init_pkg(lua_State *L) { if(!luaL_newmetatable(L, "threads.Thread")) luaL_error(L, "threads: threads.Thread type already exists"); - luaT_setfuncs(L, thread__, 0); + luaL_setfuncs(L, thread__, 0); lua_pushstring(L, "__index"); lua_pushvalue(L, -2); lua_rawset(L, -3); @@ -234,7 +234,7 @@ static void thread_init_pkg(lua_State *L) if(!luaL_newmetatable(L, "threads.Mutex")) luaL_error(L, "threads: threads.Mutex type already exists"); - luaT_setfuncs(L, mutex__, 0); + luaL_setfuncs(L, mutex__, 0); lua_pushstring(L, "__index"); lua_pushvalue(L, -2); lua_rawset(L, -3); @@ -242,7 +242,7 @@ static void thread_init_pkg(lua_State *L) if(!luaL_newmetatable(L, "threads.Condition")) luaL_error(L, "threads: threads.Condition type already exists"); - luaT_setfuncs(L, condition__, 0); + luaL_setfuncs(L, condition__, 0); lua_pushstring(L, "__index"); lua_pushvalue(L, -2); lua_rawset(L, -3); |