util-src/*.c: Add macro for compiling with Lua 5.2
authorKim Alvefur <zash@zash.se>
Wed, 17 Sep 2014 12:30:29 +0000 (14:30 +0200)
committerKim Alvefur <zash@zash.se>
Wed, 17 Sep 2014 12:30:29 +0000 (14:30 +0200)
util-src/encodings.c
util-src/hashes.c
util-src/net.c
util-src/pposix.c
util-src/signal.c
util-src/windows.c

index fb8385517c15ef87afc3b3a5ca5800ae6802a56d..2d5d49d497f70448f2f5f22185e076dcd487a8fa 100644 (file)
 #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[]=
index 39ab51802060c88791e18a287e612adc401f9b06..459f75ac870538c4207ff67b03ab38e5e54cd952 100644 (file)
@@ -27,6 +27,10 @@ typedef unsigned __int32 uint32_t;
 #include <openssl/sha.h>
 #include <openssl/md5.h>
 
+#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
 
index 84d7e84ec9e2956432e7ac3c4902502476a88e07..9e57854c84b13369cc4da04976f61ed9d4ae02b4 100644 (file)
 #include <lua.h>
 #include <lauxlib.h>
 
+#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[] = {
index 62bd0339486ffa3c5f2d591b2ff739e91a4db740..49e80f711f0bac54211c5cc8c260edb9940d4bde 100644 (file)
 #include "lualib.h"
 #include "lauxlib.h"
 
+#if (LUA_VERSION_NUM == 502)
+#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0)
+#endif
+
 #include <fcntl.h>
 #if defined(__linux__) && defined(_GNU_SOURCE)
 #include <linux/falloc.h>
index 3d0a8a50b2ab8ff3505a03def27c3a0d50264ce8..63d655707e682fde2549bbff751289343952fa4f 100644 (file)
 #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
index a209539f756f889638bd3fca4c2b18c701462ba0..37f850e35070eccaf140721adece23d8c626c3dd 100644 (file)
 #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;