From a11adeea4ad1fe38cd2f267ca62de32ce9c5d629 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Wed, 3 May 2017 13:06:10 +0200 Subject: [PATCH] Fix luasocket compatibility with luajit 2.1.0 beta 3 (fix #1277) Note that luasocket 3.0 (in minor) targets lua 5.1, so it does not rely on a 5.0 compatibility feature, and does not require this patch. Since a 0.10.3 release seems unlikely at this point, this commit is mostly targeted at future packagers of older love versions. --- changes.txt | 1 + src/libraries/luasocket/libluasocket/lua.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changes.txt b/changes.txt index 849ef40b8..66c6b9a35 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,7 @@ Released: N/A * Fixed Shader:send and Shader:sendColor ignoring the last argument for an array. * Fixed a crash when love.graphics.pop is called after a love.window.setMode while the transformation stack was not empty. * Fixed BezierCurves to error instead of hanging in some situations. + * Fixed compilation of luasocket with newer luajit 2.1.0 beta versions. * Improved command line argument handling. * Improved seeking support, especially for short video files. diff --git a/src/libraries/luasocket/libluasocket/lua.h b/src/libraries/luasocket/libluasocket/lua.h index a280df842..c4215ecb7 100644 --- a/src/libraries/luasocket/libluasocket/lua.h +++ b/src/libraries/luasocket/libluasocket/lua.h @@ -6,9 +6,12 @@ #include #include -#if LUA_VERSION_NUM > 501 +#if LUA_VERSION_NUM >= 501 +# undef luaL_reg # define luaL_reg luaL_Reg +# undef luaL_putchar # define luaL_putchar(B, c) luaL_addchar(B, c) +# undef luaL_typerror # define luaL_typerror(L, n, t) luax_typerror(L, n, t) extern int luax_typerror(lua_State *L, int narg, const char *type);