From 7b90a331bf1caecfa1ba1e2f3e7f87fa01c389b9 Mon Sep 17 00:00:00 2001 From: moteus Date: Thu, 26 Dec 2013 13:08:45 +0400 Subject: Fix. load library on Lua 5.2 --- src/l52util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/l52util.c') diff --git a/src/l52util.c b/src/l52util.c index 592c1d1..0b40c3e 100644 --- a/src/l52util.c +++ b/src/l52util.c @@ -43,6 +43,11 @@ void lua_rawsetp (lua_State *L, int index, const void *p){ lua_rawset(L, index); } +void lutil_require(lua_State *L, const char* name, lua_CFunction fn, int glb) { + // @fixme generate error if we can not load module + lua_cpcall(L, fn, NULL); +} + #endif int lutil_newmetatablep (lua_State *L, const void *p) { -- cgit v1.2.3-55-g6feb