aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-15 01:17:53 +0200
committerKim Alvefur <zash@zash.se>2018-09-15 01:17:53 +0200
commit128f7d4593499a19ee333ae5b20f4d5fbb630725 (patch)
treef82ed19b005ad3af5c01e37ac1e7b638c7c70842 /util-src
parentafea46904dc04f7e2cf2c0274a6079c219bab873 (diff)
downloadprosody-128f7d4593499a19ee333ae5b20f4d5fbb630725.tar.gz
prosody-128f7d4593499a19ee333ae5b20f4d5fbb630725.zip
util.poll: Lua 5.1 compat
Diffstat (limited to 'util-src')
-rw-r--r--util-src/poll.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util-src/poll.c b/util-src/poll.c
index e80850d2..c0a93b04 100644
--- a/util-src/poll.c
+++ b/util-src/poll.c
@@ -34,6 +34,10 @@
#define STATE_MT "util.poll.select"
#endif
+#if (LUA_VERSION_NUM == 501)
+#define luaL_setmetatable(L, tname) luaL_getmetatable(L, tname); lua_setmetatable(L, -2)
+#endif
+
/*
* Structure to keep state for each type of API
*/
@@ -380,7 +384,9 @@ int Lnew(lua_State *L) {
* Open library
*/
int luaopen_util_poll(lua_State *L) {
+#if (LUA_VERSION_NUM > 501)
luaL_checkversion(L);
+#endif
luaL_newmetatable(L, STATE_MT);
{