From bc327e3ea486d0e9316d208a8d13fe0ed13deb68 Mon Sep 17 00:00:00 2001 From: Dmitry Zaitsev Date: Wed, 28 Jan 2015 22:38:06 +0300 Subject: [PATCH] compatibility with Lua 5.3 from http://www.lua.org/manual/5.3/manual.html#8.3 > Macros to project non-default integer types (luaL_checkint, luaL_optint, luaL_checklong, luaL_optlong) were deprecated --- lua_zlib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua_zlib.c b/lua_zlib.c index 3f7186e..9d1f4a5 100644 --- a/lua_zlib.c +++ b/lua_zlib.c @@ -8,13 +8,18 @@ /* * ** compatibility with Lua 5.2 * */ -#if (LUA_VERSION_NUM == 502) +#if (LUA_VERSION_NUM >= 502) #undef luaL_register #define luaL_register(L,n,f) \ { if ((n) == NULL) luaL_setfuncs(L,f,0); else luaL_newlib(L,f); } #endif +#if (LUA_VERSION_NUM >= 503) +#undef luaL_optint +#define luaL_optint(L,n,d) ((int)luaL_optinteger(L,(n),(d))) +#endif + #define DEF_MEM_LEVEL 8 typedef uLong (*checksum_t) (uLong crc, const Bytef *buf, uInt len);