From bcab7a928a24ff7da693c6c8370ab18ae19284bd Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 16 Sep 2014 21:56:18 +0200 Subject: util-src/*.c: Don't create globals when loaded --- util-src/pposix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util-src/pposix.c') diff --git a/util-src/pposix.c b/util-src/pposix.c index 9b3e97eb..62bd0339 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -768,7 +768,8 @@ int luaopen_util_pposix(lua_State *L) { NULL, NULL } }; - luaL_register(L, "pposix", exports); + lua_newtable(L); + luaL_register(L, NULL, exports); lua_pushliteral(L, "pposix"); lua_setfield(L, -2, "_NAME"); -- cgit v1.2.3 From 140603714f5b35405871a8040f8d14e650db7221 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 17 Sep 2014 14:30:29 +0200 Subject: util-src/*.c: Add macro for compiling with Lua 5.2 --- util-src/pposix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util-src/pposix.c') diff --git a/util-src/pposix.c b/util-src/pposix.c index 62bd0339..49e80f71 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -35,6 +35,10 @@ #include "lualib.h" #include "lauxlib.h" +#if (LUA_VERSION_NUM == 502) +#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) +#endif + #include #if defined(__linux__) && defined(_GNU_SOURCE) #include -- cgit v1.2.3