Add extra LUA_NAMESPACE

This commit is contained in:
Edoardo Lolletti 2025-07-05 19:50:36 +02:00
parent b0fd826aa6
commit 481031ba9e
6 changed files with 14 additions and 0 deletions

View file

@ -32,7 +32,10 @@
#define LUA_INLINE ForceInline
#endif
#define LUA_NAMESPACE
namespace {
namespace LUA_NAMESPACE {
namespace Detail {
template<std::size_t N>
@ -115,6 +118,7 @@ constexpr auto make_lua_functions_array() {
#endif
} // namespace Detail
} // namespace LUA_NAMESPACE
} // namespace
#define GET_LUA_FUNCTIONS_ARRAY() \

View file

@ -19,6 +19,7 @@
#include "function_array_helper.h"
namespace {
namespace LUA_NAMESPACE {
using namespace scriptlib;
@ -2202,6 +2203,7 @@ LUA_FUNCTION_EXISTING(GetLuaRef, get_lua_ref<card>);
LUA_FUNCTION_EXISTING(FromLuaRef, from_lua_ref<card>);
LUA_FUNCTION_EXISTING(IsDeleted, is_deleted_object);
}
}
void scriptlib::push_card_lib(lua_State* L) {
static constexpr auto cardlib = GET_LUA_FUNCTIONS_ARRAY();

View file

@ -13,6 +13,7 @@
#include "function_array_helper.h"
namespace {
namespace LUA_NAMESPACE {
using namespace scriptlib;
@ -235,6 +236,7 @@ LUA_STATIC_FUNCTION(CardToStringWrapper) {
return 1;
}
}
}
void scriptlib::push_debug_lib(lua_State* L) {

View file

@ -19,6 +19,7 @@
#include "function_array_helper.h"
namespace {
namespace LUA_NAMESPACE {
using namespace scriptlib;
@ -4181,6 +4182,7 @@ LUA_STATIC_FUNCTION(GetCardSetcodeFromCode) {
return static_cast<int32_t>(data.setcodes.size());
}
}
}
void scriptlib::push_duel_lib(lua_State* L) {
static constexpr auto duellib = GET_LUA_FUNCTIONS_ARRAY();

View file

@ -14,6 +14,7 @@
#include "function_array_helper.h"
namespace {
namespace LUA_NAMESPACE {
using namespace scriptlib;
@ -470,6 +471,7 @@ LUA_FUNCTION_EXISTING(GetLuaRef, get_lua_ref<effect>);
LUA_FUNCTION_EXISTING(FromLuaRef, from_lua_ref<effect>);
LUA_FUNCTION_EXISTING(IsDeleted, is_deleted_object);
}
}
void scriptlib::push_effect_lib(lua_State* L) {
static constexpr auto effectlib = GET_LUA_FUNCTIONS_ARRAY();

View file

@ -21,6 +21,7 @@
#include "function_array_helper.h"
namespace {
namespace LUA_NAMESPACE {
using namespace scriptlib;
@ -800,6 +801,7 @@ LUA_FUNCTION_EXISTING(GetLuaRef, get_lua_ref<group>);
LUA_FUNCTION_EXISTING(FromLuaRef, from_lua_ref<group>);
LUA_FUNCTION_EXISTING(IsDeleted, is_deleted_object);
}
}
void scriptlib::push_group_lib(lua_State* L) {
static constexpr auto grouplib = GET_LUA_FUNCTIONS_ARRAY();