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/encodings.c | 4 ++++ util-src/hashes.c | 4 ++++ util-src/net.c | 4 ++++ util-src/pposix.c | 4 ++++ util-src/signal.c | 4 ++++ util-src/windows.c | 4 ++++ 6 files changed, 24 insertions(+) (limited to 'util-src') diff --git a/util-src/encodings.c b/util-src/encodings.c index fb838551..2d5d49d4 100644 --- a/util-src/encodings.c +++ b/util-src/encodings.c @@ -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 --git a/util-src/hashes.c b/util-src/hashes.c index 39ab5180..459f75ac 100644 --- a/util-src/hashes.c +++ b/util-src/hashes.c @@ -27,6 +27,10 @@ typedef unsigned __int32 uint32_t; #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 --git a/util-src/net.c b/util-src/net.c index 84d7e84e..9e57854c 100644 --- a/util-src/net.c +++ b/util-src/net.c @@ -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 --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 diff --git a/util-src/signal.c b/util-src/signal.c index 3d0a8a50..63d65570 100644 --- a/util-src/signal.c +++ b/util-src/signal.c @@ -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 --git a/util-src/windows.c b/util-src/windows.c index a209539f..37f850e3 100644 --- a/util-src/windows.c +++ b/util-src/windows.c @@ -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; -- cgit v1.2.3