summaryrefslogtreecommitdiff
path: root/source/3rd-party/Luax
diff options
context:
space:
mode:
Diffstat (limited to 'source/3rd-party/Luax')
-rw-r--r--source/3rd-party/Luax/luax_class.hpp5
-rw-r--r--source/3rd-party/Luax/luax_state.cpp8
2 files changed, 8 insertions, 5 deletions
diff --git a/source/3rd-party/Luax/luax_class.hpp b/source/3rd-party/Luax/luax_class.hpp
index 08b4e3f..e056b75 100644
--- a/source/3rd-party/Luax/luax_class.hpp
+++ b/source/3rd-party/Luax/luax_class.hpp
@@ -44,7 +44,7 @@ namespace Luax
#define LUAX_DECL_METHOD(mtd) static int mtd(lua_State* L)
-#define LUAX_DECL_ENUM(e)
+#define LUAX_DECL_ENUM(e, under_line_index) static void _luax_decl_enum_##e()
///
/// ʵֵĺꡣһL
@@ -62,6 +62,7 @@ namespace Luax
///
#define LUAX_REGISTER_FACTORY(state, type) state.RegisterFactory<type>()
#define LUAX_REGISTER_SINGLETON(state, type) state.RegisterSingleton<type>()
+#define LUAX_REGISTER_ABSTRACT_FACTORY(state, type) type::RegisterLuaxPostprocess(state)
#define LUAX_REGISTER_METHODS(state, ...) \
do{ \
luaL_Reg __m[] = {__VA_ARGS__,{0, 0}}; \
@@ -77,6 +78,8 @@ namespace Luax
LUAX_STATE(L); \
T* self = state.GetUserdata<T>(1);
+#define LUAX_INHERIT(state, type) type::RegisterLuaxClass(state)
+
///
/// ࣬Ϊʵֶ̬ҪЩӿڵⲿҪ̳д֮࣬оͻ
/// öӦʵķע̳дʱʵķʵLuaxNativeClassУʵֻ
diff --git a/source/3rd-party/Luax/luax_state.cpp b/source/3rd-party/Luax/luax_state.cpp
index 3eae1df..612f26e 100644
--- a/source/3rd-party/Luax/luax_state.cpp
+++ b/source/3rd-party/Luax/luax_state.cpp
@@ -314,7 +314,7 @@ namespace Luax
lua_gettable(mState, idx);
}
- std::string LuaxState::GetField(int idx, cc8* key, cc8* value)
+ std::string LuaxState::GetField(int idx, cc8* key, cc8* default_value)
{
std::string str;
if (this->GetFieldWithType(idx, key, LUA_TSTRING)) {
@@ -322,12 +322,12 @@ namespace Luax
lua_pop(mState, 1);
}
else {
- str = value;
+ str = default_value;
}
return str;
}
- std::string LuaxState::GetField(int idx, int key, cc8* value)
+ std::string LuaxState::GetField(int idx, int key, cc8* default_value)
{
std::string str;
if (this->GetFieldWithType(idx, key, LUA_TSTRING)) {
@@ -335,7 +335,7 @@ namespace Luax
lua_pop(mState, 1);
}
else {
- str = value;
+ str = default_value;
}
return str;
}