From 0ef254d0d5ea2619a295fe1c3832c886f70e5140 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Mon, 10 Feb 2014 13:40:52 +0400 Subject: Fix. build for Lua 5.2 with LUA_COMPAT_XXX --- src/l52util.c | 4 ++++ src/l52util.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/l52util.c b/src/l52util.c index 0b40c3e..9d44a40 100644 --- a/src/l52util.c +++ b/src/l52util.c @@ -11,11 +11,15 @@ int luaL_typerror (lua_State *L, int narg, const char *tname) { return luaL_argerror(L, narg, msg); } +#ifndef luaL_register + void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l){ if(libname) lua_newtable(L); luaL_setfuncs(L, l, 0); } +#endif + #else void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup){ diff --git a/src/l52util.h b/src/l52util.h index 94f1bfa..38a87db 100644 --- a/src/l52util.h +++ b/src/l52util.h @@ -11,13 +11,19 @@ // luaL_setfuncs // lua_absindex +#ifndef lua_objlen #define lua_objlen lua_rawlen +#endif + int luaL_typerror (lua_State *L, int narg, const char *tname); +#ifndef luaL_register + void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l); +#endif #define lutil_require luaL_requiref -- cgit v1.2.3-55-g6feb