diff --git a/function_array_helper.h b/function_array_helper.h index a1f735f..993354f 100644 --- a/function_array_helper.h +++ b/function_array_helper.h @@ -32,7 +32,10 @@ #define LUA_INLINE ForceInline #endif +#define LUA_NAMESPACE + namespace { +namespace LUA_NAMESPACE { namespace Detail { template @@ -115,6 +118,7 @@ constexpr auto make_lua_functions_array() { #endif } // namespace Detail +} // namespace LUA_NAMESPACE } // namespace #define GET_LUA_FUNCTIONS_ARRAY() \ diff --git a/libcard.cpp b/libcard.cpp index 9e9a013..48cd6fd 100644 --- a/libcard.cpp +++ b/libcard.cpp @@ -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); LUA_FUNCTION_EXISTING(FromLuaRef, from_lua_ref); LUA_FUNCTION_EXISTING(IsDeleted, is_deleted_object); } +} void scriptlib::push_card_lib(lua_State* L) { static constexpr auto cardlib = GET_LUA_FUNCTIONS_ARRAY(); diff --git a/libdebug.cpp b/libdebug.cpp index bbd3886..b38629f 100644 --- a/libdebug.cpp +++ b/libdebug.cpp @@ -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) { diff --git a/libduel.cpp b/libduel.cpp index f8148e4..bbab7af 100644 --- a/libduel.cpp +++ b/libduel.cpp @@ -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(data.setcodes.size()); } } +} void scriptlib::push_duel_lib(lua_State* L) { static constexpr auto duellib = GET_LUA_FUNCTIONS_ARRAY(); diff --git a/libeffect.cpp b/libeffect.cpp index c098665..fb67a4a 100644 --- a/libeffect.cpp +++ b/libeffect.cpp @@ -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); LUA_FUNCTION_EXISTING(FromLuaRef, from_lua_ref); LUA_FUNCTION_EXISTING(IsDeleted, is_deleted_object); } +} void scriptlib::push_effect_lib(lua_State* L) { static constexpr auto effectlib = GET_LUA_FUNCTIONS_ARRAY(); diff --git a/libgroup.cpp b/libgroup.cpp index fdad16b..1053240 100644 --- a/libgroup.cpp +++ b/libgroup.cpp @@ -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); LUA_FUNCTION_EXISTING(FromLuaRef, from_lua_ref); LUA_FUNCTION_EXISTING(IsDeleted, is_deleted_object); } +} void scriptlib::push_group_lib(lua_State* L) { static constexpr auto grouplib = GET_LUA_FUNCTIONS_ARRAY();