Repository: thrift Updated Branches: refs/heads/master d6de19925 -> 3641b5435
THRIFT-4170: fix lua backwards compatibility Client: lua Patch: wlgys8 <147668...@qq.com> This closes #669 This closes #1241 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3641b543 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3641b543 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3641b543 Branch: refs/heads/master Commit: 3641b54352f1c810ba3f60176d51472bfafdc6e0 Parents: d6de199 Author: James E. King, III <jk...@apache.org> Authored: Thu Apr 6 17:48:23 2017 -0400 Committer: James E. King, III <jk...@apache.org> Committed: Thu Apr 6 17:49:05 2017 -0400 ---------------------------------------------------------------------- lib/lua/src/luabpack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/3641b543/lib/lua/src/luabpack.c ---------------------------------------------------------------------- diff --git a/lib/lua/src/luabpack.c b/lib/lua/src/luabpack.c index a86fc3e..077b6aa 100644 --- a/lib/lua/src/luabpack.c +++ b/lib/lua/src/luabpack.c @@ -104,10 +104,10 @@ static int l_bunpack(lua_State *L) { const char *code = luaL_checkstring(L, 1); luaL_argcheck(L, code[1] == '\0', 0, "Format code must be one character."); const char *data = luaL_checkstring(L, 2); -#ifdef _LUA51_ - size_t len = lua_objlen(L, 2); -#else +#if LUA_VERSION_NUM >= 502 size_t len = lua_rawlen(L, 2); +#else + size_t len = lua_objlen(L, 2); #endif switch (code[0]) {