Improvements on LUA build scripts and support for LUA 5.2

This commit is contained in:
Victor Hora
2017-11-23 12:38:23 -05:00
committed by Felipe Zimmerle
parent de36fca86a
commit c98e665475
3 changed files with 99 additions and 16 deletions

View File

@@ -83,7 +83,11 @@ bool Lua::load(std::string script, std::string *err) {
return false;
}
#ifdef WITH_LUA_5_2
if (lua_dump(L, Lua::blob_keeper, reinterpret_cast<void *>(&m_blob))) {
#else
if (lua_dump(L, Lua::blob_keeper, reinterpret_cast<void *>(&m_blob), 0)) {
#endif
const char *luaerr = lua_tostring(L, -1);
err->assign("Failed to compile script '" + script + "");
if (luaerr) {
@@ -95,7 +99,6 @@ bool Lua::load(std::string script, std::string *err) {
return false;
}
lua_close(L);
return true;
#else