From f5cf8297aebfe8f23ccf086a671d6cacd1c1613e Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Sun, 22 Sep 2019 13:43:18 -0700 Subject: use macro instead of header defines for Lua 5.2+ support --- lua_cjson.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lua_cjson.c') diff --git a/lua_cjson.c b/lua_cjson.c index 020ba21..45ebe78 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -36,10 +36,6 @@ * difficult to know object/array sizes ahead of time. */ - -#define LUA_COMPAT_ALL 1 -#define LUA_COMPAT_5_1 1 - #include #include #include @@ -106,6 +102,10 @@ #define json_lightudata_mask(ludata) (ludata) #endif +#if LUA_VERSION_NUM > 501 +#define lua_objlen(L,i) lua_rawlen(L, (i)) +#endif + static const char * const *json_empty_array; static const char * const *json_array; -- cgit v1.2.3-55-g6feb