1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00

Fix compile error with Lua 5.3

lua_gettable returns an int instead of void in Lua 5.3, so provide a
backwards-compatible overload of safe_misc_trampoline to account for this.
Tested with Lua 5.2 and 5.3.

This change does not address other compilation issues related to Lua bindings
for cairo, imlib2, and rsvg.

Fixes #90 and part of #100.
This commit is contained in:
Marc Payne 2015-08-21 01:56:37 -06:00
parent 71c8072192
commit acd1c05d74

View File

@ -171,6 +171,14 @@ namespace lua {
return nresults;
}
// Overloaded for Lua 5.3+ as lua_gettable and others return an int
template<int (*misc)(lua_State *, int), int nresults>
int safe_misc_trampoline(lua_State *l)
{
misc(l, 1);
return nresults;
}
int safe_next_trampoline(lua_State *l)
{
int r = lua_next(l, 1);