aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/windows.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-18 02:22:48 +0200
committerKim Alvefur <zash@zash.se>2014-09-18 02:22:48 +0200
commit31be1596b93612e1c848402bd21207ad06ae30e8 (patch)
tree361f642064745fd1a6601050e7573062ff65e2ad /util-src/windows.c
parent57b543c70405092fc24f859c05c734fc8b361030 (diff)
parentb19f5a09a19534973d522e7400139f040d76391b (diff)
downloadprosody-31be1596b93612e1c848402bd21207ad06ae30e8.tar.gz
prosody-31be1596b93612e1c848402bd21207ad06ae30e8.zip
Merge 0.10->trunk
Diffstat (limited to 'util-src/windows.c')
-rw-r--r--util-src/windows.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/util-src/windows.c b/util-src/windows.c
index 3d14ca95..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;
@@ -81,9 +85,9 @@ static const luaL_Reg Reg[] =
};
LUALIB_API int luaopen_util_windows(lua_State *L) {
- luaL_register(L, "windows", Reg);
- lua_pushliteral(L, "version"); /** version */
+ lua_newtable(L);
+ luaL_register(L, NULL, Reg);
lua_pushliteral(L, "-3.14");
- lua_settable(L,-3);
+ lua_setfield(L, -2, "version");
return 1;
}