# HG changeset patch # User Kim Alvefur # Date 1410957029 -7200 # Node ID a552f4170aed5ca005c96179d51c896abf304d00 # Parent 0e94f89d0e622920ff8a10d7c7e2caa3b17cd639 util-src/*.c: Add macro for compiling with Lua 5.2 diff -r 0e94f89d0e62 -r a552f4170aed util-src/encodings.c --- a/util-src/encodings.c Wed Sep 17 02:23:17 2014 +0200 +++ b/util-src/encodings.c Wed Sep 17 14:30:29 2014 +0200 @@ -20,6 +20,10 @@ #include "lua.h" #include "lauxlib.h" +#if (LUA_VERSION_NUM == 502) +#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) +#endif + /***************** BASE64 *****************/ static const char code[]= diff -r 0e94f89d0e62 -r a552f4170aed util-src/hashes.c --- a/util-src/hashes.c Wed Sep 17 02:23:17 2014 +0200 +++ b/util-src/hashes.c Wed Sep 17 14:30:29 2014 +0200 @@ -27,6 +27,10 @@ #include #include +#if (LUA_VERSION_NUM == 502) +#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) +#endif + #define HMAC_IPAD 0x36363636 #define HMAC_OPAD 0x5c5c5c5c diff -r 0e94f89d0e62 -r a552f4170aed util-src/net.c --- a/util-src/net.c Wed Sep 17 02:23:17 2014 +0200 +++ b/util-src/net.c Wed Sep 17 14:30:29 2014 +0200 @@ -26,6 +26,10 @@ #include #include +#if (LUA_VERSION_NUM == 502) +#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) +#endif + /* Enumerate all locally configured IP addresses */ const char * const type_strings[] = { diff -r 0e94f89d0e62 -r a552f4170aed util-src/pposix.c --- a/util-src/pposix.c Wed Sep 17 02:23:17 2014 +0200 +++ b/util-src/pposix.c Wed Sep 17 14:30:29 2014 +0200 @@ -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 diff -r 0e94f89d0e62 -r a552f4170aed util-src/signal.c --- a/util-src/signal.c Wed Sep 17 02:23:17 2014 +0200 +++ b/util-src/signal.c Wed Sep 17 14:30:29 2014 +0200 @@ -32,6 +32,10 @@ #include "lua.h" #include "lauxlib.h" +#if (LUA_VERSION_NUM == 502) +#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) +#endif + #ifndef lsig #define lsig diff -r 0e94f89d0e62 -r a552f4170aed util-src/windows.c --- a/util-src/windows.c Wed Sep 17 02:23:17 2014 +0200 +++ b/util-src/windows.c Wed Sep 17 14:30:29 2014 +0200 @@ -19,6 +19,10 @@ #include "lua.h" #include "lauxlib.h" +#if (LUA_VERSION_NUM == 502) +#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0) +#endif + static int Lget_nameservers(lua_State *L) { char stack_buffer[1024]; // stack allocated buffer IP4_ARRAY* ips = (IP4_ARRAY*) stack_buffer;