diff options
author | Manuel BACHMANN <tarnyko@tarnyko.net> | 2020-02-24 11:04:54 +0100 |
---|---|---|
committer | Manuel BACHMANN <tarnyko@tarnyko.net> | 2020-02-24 11:04:54 +0100 |
commit | 6c0b8a40f7938c027953bd4c650a02e8aad77861 (patch) | |
tree | 41ea62e1a8f7925d8b17ace0bcc2fbc228e3388d /libs/luci-lib-nixio/src/nixio.h | |
parent | 562425605af51443986cb2596199564e4102ffff (diff) |
luci-lib-nixio: allow building with Lua5.2/LuaJIT
Lua 5.1 defines a "luaL_Reg" alias for deprecated
"luaL_reg", but Lua >= 5.2 and LuaJIT do not.
Replace by "luaL_Reg", and define a "luaL_reg"
alias in case we build with old Lua 5.0.
Signed-off-by: Manuel BACHMANN <tarnyko@tarnyko.net>
Diffstat (limited to 'libs/luci-lib-nixio/src/nixio.h')
-rw-r--r-- | libs/luci-lib-nixio/src/nixio.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/luci-lib-nixio/src/nixio.h b/libs/luci-lib-nixio/src/nixio.h index 8802e92043..5eb84d11ae 100644 --- a/libs/luci-lib-nixio/src/nixio.h +++ b/libs/luci-lib-nixio/src/nixio.h @@ -21,6 +21,10 @@ #include <lauxlib.h> #include <luaconf.h> +#if LUA_VERSION_NUM < 501 +#define luaL_Reg luaL_reg +#endif + #define NIXIO_BUFFERSIZE 8192 typedef struct nixio_socket { |