aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-17 14:30:29 +0200
committerKim Alvefur <zash@zash.se>2014-09-17 14:30:29 +0200
commit8affcc3ff7d35ca73fe748418046bec386496cd2 (patch)
tree341cdc51552c918b49129cd566b2c7b1726bcc46
parent4f6f0fe48047cf1832061f52aa96b9df5d9460fa (diff)
downloadprosody-8affcc3ff7d35ca73fe748418046bec386496cd2.tar.gz
prosody-8affcc3ff7d35ca73fe748418046bec386496cd2.zip
util-src/*.c: Add macro for compiling with Lua 5.2
-rw-r--r--util-src/encodings.c4
-rw-r--r--util-src/hashes.c4
-rw-r--r--util-src/net.c4
-rw-r--r--util-src/pposix.c4
-rw-r--r--util-src/signal.c4
-rw-r--r--util-src/windows.c4
6 files changed, 24 insertions, 0 deletions
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 <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
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 <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[] = {
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 <fcntl.h>
#if defined(__linux__) && defined(_GNU_SOURCE)
#include <linux/falloc.h>
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;