LuaPlus extenssion

This commit is contained in:
2026-03-05 05:05:04 +03:00
parent 33104c3bca
commit d57ac17b69
10 changed files with 183 additions and 50 deletions

View File

@@ -35,8 +35,8 @@ public:
functionObj.Push(L);
if (lua_pcall(L, 0, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -50,8 +50,8 @@ public:
LPCD::Type<P1>::Push(L, p1);
if (lua_pcall(L, 1, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -66,8 +66,8 @@ public:
LPCD::Type<P2>::Push(L, p2);
if (lua_pcall(L, 2, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -83,8 +83,8 @@ public:
LPCD::Type<P3>::Push(L, p3);
if (lua_pcall(L, 3, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -101,8 +101,8 @@ public:
LPCD::Type<P4>::Push(L, p4);
if (lua_pcall(L, 4, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -120,8 +120,8 @@ public:
LPCD::Type<P5>::Push(L, p5);
if (lua_pcall(L, 5, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -140,8 +140,8 @@ public:
LPCD::Type<P6>::Push(L, p6);
if (lua_pcall(L, 6, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -161,8 +161,8 @@ public:
LPCD::Type<P7>::Push(L, p7);
if (lua_pcall(L, 7, 1, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
return LPCD::Type<RT>::Get(L, -1);
}
@@ -191,8 +191,8 @@ public:
functionObj.Push(L);
if (lua_pcall(L, 0, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}
@@ -205,8 +205,8 @@ public:
LPCD::Type<P1>::Push(L, p1);
if (lua_pcall(L, 1, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}
@@ -220,8 +220,8 @@ public:
LPCD::Type<P2>::Push(L, p2);
if (lua_pcall(L, 2, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}
@@ -236,8 +236,8 @@ public:
LPCD::Type<P3>::Push(L, p3);
if (lua_pcall(L, 3, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}
@@ -253,8 +253,8 @@ public:
LPCD::Type<P4>::Push(L, p4);
if (lua_pcall(L, 4, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}
@@ -271,8 +271,8 @@ public:
LPCD::Type<P5>::Push(L, p5);
if (lua_pcall(L, 5, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}
@@ -290,8 +290,8 @@ public:
LPCD::Type<P6>::Push(L, p6);
if (lua_pcall(L, 6, 0, 0)) {
const char* errorString = lua_tostring(L, -1); (void)errorString;
luaplus_assert(0);
const char* errorString = lua_tostring(L, -1);
g_errorFunction(errorString);
}
}

View File

@@ -94,4 +94,8 @@ struct LuaArgNil {};
#define LuaState_to_lua_State(state) ((lua_State*)(state))
#define lua_State_to_LuaState(L) ((LuaPlus::LuaState*)L)
namespace LuaPlus {
extern void (*g_errorFunction)(const char* errorMsg);
}
#endif // LUAPLUS__LUAPLUSINTERNAL_H