From abb3d56a45ea27fff98d9a0f1165a13712518d5b Mon Sep 17 00:00:00 2001 From: Lorenzo Cogotti Date: Mon, 12 Dec 2022 15:47:34 +0100 Subject: [PATCH] [luacompat] luaL_pushfail() was actually introduced with Lua 5.3. --- luacompat.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/luacompat.h b/luacompat.h index d9f8dc9..834a8f6 100644 --- a/luacompat.h +++ b/luacompat.h @@ -17,8 +17,6 @@ typedef struct { FILE *f; } luaL_Stream; -#define luaL_pushfail(L) lua_pushnil(L) - static inline void luaL_requiref(lua_State *L, const char *modname, lua_CFunction openf, int glb) { lua_pushstring(L, "_LOADED"); @@ -48,4 +46,9 @@ static inline void luaL_requiref(lua_State *L, const char *modname, lua_CFunctio } #endif + +#if LUA_VERSION_NUM < 503 +#define luaL_pushfail(L) lua_pushnil(L) +#endif + #endif