Commits
- Commit:
253efe7357b42df840d4dc45a55f0cf4a765df34- From:
- Sergey Bronnikov <estetus@gmail.com>
- Via:
- Sergey Bronnikov <sergeyb@tarantool.org>
- Date:
luzer: fix memory leak in FDP
Fixes #52
- Commit:
fc4a32fe98f1da8b07f74a35f40b678692e7152b- From:
- Sergey Bronnikov <estetus@gmail.com>
- Date:
luzer: fix compilation with latest PUC Rio Lua
The compilation is broken with the latest version of PUC Rio Lua:
```
/home/runner/work/lua-c-api-tests/lua-c-api-tests/build/luzer/source/luzer/custom_mutator_lib.c:19:33: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
19 | size_t lua_objlen(lua_State *L, int index);
| ^
/home/runner/work/lua-c-api-tests/lua-c-api-tests/build/luzer/source/luzer/custom_mutator_lib.c:19:8: error: conflicting types for 'lua_rawlen'
19 | size_t lua_objlen(lua_State *L, int index);
| ^
/home/runner/work/lua-c-api-tests/lua-c-api-tests/build/lua-master/source/luaconf.h:357:26: note: expanded from macro 'lua_objlen'
357 | #define lua_objlen(L,i) lua_rawlen(L, (i))
| ^
/home/runner/work/lua-c-api-tests/lua-c-api-tests/build/lua-master/source/lua.h:204:26: note: previous declaration is here
204 | LUA_API lua_Unsigned (lua_rawlen) (lua_State *L, int idx);
| ^
2 errors generated.
```
The patch fixes that by adding a macro `lua_objlen`, the function
`lua_objlen()` is not available in Lua 5.2+ as it was renamed to
`lua_rawlen()`, see "8.3 – Changes in the API" in Lua 5.2
Reference Manual [1].
Also, linkage specification under the macro `__cplusplus` was
removed because it is not needed.
1. https://www.lua.org/manual/5.2/manual.html
