From 593036e1b9582e6cb012c8317ce2b8af2ba13831 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 29 Jul 2024 16:21:51 +0200 Subject: Fix luaG_setmetatable --- src/compat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compat.h b/src/compat.h index 23dbc03..9e15230 100644 --- a/src/compat.h +++ b/src/compat.h @@ -318,8 +318,8 @@ inline void luaG_setfield(lua_State* const L_, int const idx_, std::string_view inline void luaG_setmetatable(lua_State* const L_, std::string_view const& tname_) { // fake externs to make clang happy... - extern void luaL_setmetatable(lua_State* const L_, char const* const tname_); // Lua 5.2+ - if constexpr (LUA_VERSION_NUM == 501) { + if constexpr (LUA_VERSION_NUM > 501) { + extern void luaL_setmetatable(lua_State* const L_, char const* const tname_); // Lua 5.2+ luaL_setmetatable(L_, tname_.data()); } else { luaL_getmetatable(L_, tname_.data()); -- cgit v1.2.3-55-g6feb