From d808fd75ff1db1821b1dd817eb4ba9a118b31090 Mon Sep 17 00:00:00 2001
From: netoholic <technoworx@gmx.de>
Date: Fri, 19 Sep 2025 15:17:24 +0200
Subject: [PATCH] fix build issues with lua version higher than 5.1

refer to https://bugs.gentoo.org/963055

I´ve been asked to pass this upstream
---

Bug: https://bugs.gentoo.org/963055
Upstream-PR: https://github.com/rspamd/rspamd/pull/5625

diff --git a/src/libstat/backends/redis_backend.cxx b/src/libstat/backends/redis_backend.cxx
index 3a78de1dd..37ce6e9da 100644
--- a/src/libstat/backends/redis_backend.cxx
+++ b/src/libstat/backends/redis_backend.cxx
@@ -15,6 +15,9 @@
  */
 #include "config.h"
 #include "lua/lua_common.h"
+#if LUA_VERSION_NUM >= 502
+#  define lua_objlen lua_rawlen
+#endif
 #include "rspamd.h"
 #include "stat_internal.h"
 #include "upstream.h"
-- 
2.49.1

