aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-21 16:07:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-21 16:07:25 +0100
commit2a7ad799437105f91dfe7e89ba50de655c1d06eb (patch)
tree9edd21cf40959d0c143b906541e41aa9c5d261e6 /src/lua/lua_common.h
parentfc08274623ea616dff051d5555755dc3cfbebee8 (diff)
downloadrspamd-2a7ad799437105f91dfe7e89ba50de655c1d06eb.tar.gz
rspamd-2a7ad799437105f91dfe7e89ba50de655c1d06eb.zip
[Minor] Add lua_geti compat method
Diffstat (limited to 'src/lua/lua_common.h')
-rw-r--r--src/lua/lua_common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h
index 296b8f326..f9ec8e2e3 100644
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -605,6 +605,19 @@ gchar *rspamd_lua_get_module_name (lua_State *L);
bool rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc,
gint nret, const gchar *args, GError **err, ...);
+/**
+ * Wrapper for lua_geti from lua 5.3
+ * @param L
+ * @param index
+ * @param i
+ * @return
+ */
+#if defined( LUA_VERSION_NUM ) && LUA_VERSION_NUM <= 502
+gint rspamd_lua_geti (lua_State *L, int index, int i);
+#else
+#define rspamd_lua_geti lua_geti
+#endif
+
/* Paths defs */
#define RSPAMD_CONFDIR_INDEX "CONFDIR"
#define RSPAMD_LOCAL_CONFDIR_INDEX "LOCAL_CONFDIR"