From 4135928a9f74bf431b6cbca4ad47f00fa47aea56 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 9 Dec 2015 23:52:21 +0100 Subject: Update to Lua 5.3 --- src/control/ScriptContext.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/control/ScriptContext.cpp b/src/control/ScriptContext.cpp index b92c8e5..e92e275 100644 --- a/src/control/ScriptContext.cpp +++ b/src/control/ScriptContext.cpp @@ -34,15 +34,17 @@ namespace Control { void ScriptContext::setupEnv() { const std::pair libs[] = { {"_G", luaopen_base}, - {"bit32", luaopen_bit32}, {"math", luaopen_math}, {"string", luaopen_string}, {"table", luaopen_table}, + {"utf8", luaopen_utf8}, }; for (auto &lib : libs) { - luaL_requiref(L, lib.first, lib.second, 1); - lua_pop(L, 1); + lua_pushcfunction(L, lib.second); + lua_pushstring(L, lib.first); + lua_call(L, 1, 1); + lua_setglobal(L, lib.first); } for (const char *f : {"dofile", "loadfile", "require"}) { -- cgit v1.2.3