Merge pull request #5783 from OgreTransporter/bugfix-lua-5781

Bugfix Lua 5.4 not working
This commit is contained in:
Denis Chapligin 2020-07-28 15:52:58 +03:00 committed by GitHub
commit 57ed232423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3399,7 +3399,9 @@ namespace sol {
runtime = LUA_ERRRUN, runtime = LUA_ERRRUN,
memory = LUA_ERRMEM, memory = LUA_ERRMEM,
handler = LUA_ERRERR, handler = LUA_ERRERR,
#if SOL_LUA_VERSION < 504
gc = LUA_ERRGCMM, gc = LUA_ERRGCMM,
#endif
syntax = LUA_ERRSYNTAX, syntax = LUA_ERRSYNTAX,
file = LUA_ERRFILE, file = LUA_ERRFILE,
}; };
@ -3409,7 +3411,9 @@ namespace sol {
yielded = LUA_YIELD, yielded = LUA_YIELD,
runtime = LUA_ERRRUN, runtime = LUA_ERRRUN,
memory = LUA_ERRMEM, memory = LUA_ERRMEM,
#if SOL_LUA_VERSION < 504
gc = LUA_ERRGCMM, gc = LUA_ERRGCMM,
#endif
handler = LUA_ERRERR, handler = LUA_ERRERR,
dead = -1, dead = -1,
}; };
@ -3418,7 +3422,9 @@ namespace sol {
ok = LUA_OK, ok = LUA_OK,
syntax = LUA_ERRSYNTAX, syntax = LUA_ERRSYNTAX,
memory = LUA_ERRMEM, memory = LUA_ERRMEM,
#if SOL_LUA_VERSION < 504
gc = LUA_ERRGCMM, gc = LUA_ERRGCMM,
#endif
file = LUA_ERRFILE, file = LUA_ERRFILE,
}; };
@ -3462,8 +3468,10 @@ namespace sol {
return names[3]; return names[3];
case call_status::handler: case call_status::handler:
return names[4]; return names[4];
#if SOL_LUA_VERSION < 504
case call_status::gc: case call_status::gc:
return names[5]; return names[5];
#endif
case call_status::syntax: case call_status::syntax:
return names[6]; return names[6];
case call_status::file: case call_status::file:
@ -3485,8 +3493,10 @@ namespace sol {
return names[0]; return names[0];
case load_status::memory: case load_status::memory:
return names[1]; return names[1];
#if SOL_LUA_VERSION < 504
case load_status::gc: case load_status::gc:
return names[2]; return names[2];
#endif
case load_status::syntax: case load_status::syntax:
return names[3]; return names[3];
case load_status::file: case load_status::file:
@ -14374,9 +14384,12 @@ namespace sol {
void luacall(std::ptrdiff_t argcount, std::ptrdiff_t) { void luacall(std::ptrdiff_t argcount, std::ptrdiff_t) {
#if SOL_LUA_VERSION < 502 #if SOL_LUA_VERSION < 502
stats = static_cast<call_status>(lua_resume(lua_state(), static_cast<int>(argcount))); stats = static_cast<call_status>(lua_resume(lua_state(), static_cast<int>(argcount)));
#else #elif SOL_LUA_VERSION < 504
stats = static_cast<call_status>(lua_resume(lua_state(), nullptr, static_cast<int>(argcount))); stats = static_cast<call_status>(lua_resume(lua_state(), nullptr, static_cast<int>(argcount)));
#endif // Lua 5.1 compat #else
int nstack = 0;
stats = static_cast<call_status>(lua_resume(lua_state(), nullptr, static_cast<int>(argcount), &nstack));
#endif
} }
template<std::size_t... I, typename... Ret> template<std::size_t... I, typename... Ret>