]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: hlua: Add support for lua 5.5
authorMike Lothian <mike@fireburn.co.uk>
Fri, 2 Jan 2026 14:38:10 +0000 (14:38 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 6 Jan 2026 10:05:02 +0000 (11:05 +0100)
Lua 5.5 adds an extra argument to lua_newstate(). Since there are
already a few other ifdefs in hlua.c checking for the Lua version,
and there's a single call place, let's do the same here. This should
be safe for backporting if needed.

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
src/hlua.c

index 5109d3c04b33de822c7695ff5ec4448d83cc4e91..bb73b377c5719b98d88bd6cef0f18c0e30e233ad 100644 (file)
@@ -14027,7 +14027,11 @@ lua_State *hlua_init_state(int thread_num)
        struct prepend_path *pp;
 
        /* Init main lua stack. */
+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 505
+       L = lua_newstate(hlua_alloc, &hlua_global_allocator, luaL_makeseed(0));
+#else
        L = lua_newstate(hlua_alloc, &hlua_global_allocator);
+#endif
 
        if (!L) {
                fprintf(stderr,