diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/l52util.c | 4 | ||||
-rw-r--r-- | src/l52util.h | 6 |
2 files changed, 10 insertions, 0 deletions
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) { | |||
11 | return luaL_argerror(L, narg, msg); | 11 | return luaL_argerror(L, narg, msg); |
12 | } | 12 | } |
13 | 13 | ||
14 | #ifndef luaL_register | ||
15 | |||
14 | void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l){ | 16 | void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l){ |
15 | if(libname) lua_newtable(L); | 17 | if(libname) lua_newtable(L); |
16 | luaL_setfuncs(L, l, 0); | 18 | luaL_setfuncs(L, l, 0); |
17 | } | 19 | } |
18 | 20 | ||
21 | #endif | ||
22 | |||
19 | #else | 23 | #else |
20 | 24 | ||
21 | void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup){ | 25 | 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 @@ | |||
11 | // luaL_setfuncs | 11 | // luaL_setfuncs |
12 | // lua_absindex | 12 | // lua_absindex |
13 | 13 | ||
14 | #ifndef lua_objlen | ||
14 | 15 | ||
15 | #define lua_objlen lua_rawlen | 16 | #define lua_objlen lua_rawlen |
16 | 17 | ||
18 | #endif | ||
19 | |||
17 | int luaL_typerror (lua_State *L, int narg, const char *tname); | 20 | int luaL_typerror (lua_State *L, int narg, const char *tname); |
18 | 21 | ||
22 | #ifndef luaL_register | ||
23 | |||
19 | void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l); | 24 | void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l); |
20 | 25 | ||
26 | #endif | ||
21 | 27 | ||
22 | #define lutil_require luaL_requiref | 28 | #define lutil_require luaL_requiref |
23 | 29 | ||