Mystro256 2af4dbd
# HG changeset patch
Mystro256 2af4dbd
# User Bart van Strien <bart.bes+projects@gmail.com>
Mystro256 2af4dbd
# Date 1493809570 -7200
Mystro256 2af4dbd
# Node ID 10f58e78bbfd82b681a45aeaf1177a765726bb31
Mystro256 2af4dbd
# Parent  33511fb56ffe3f7a9d3d1471114743e2e725d6fa
Mystro256 2af4dbd
Fix luasocket compatibility with luajit 2.1.0 beta 3 (fix #1277)
Mystro256 2af4dbd
Mystro256 2af4dbd
Note that luasocket 3.0 (in minor) targets lua 5.1, so it does not rely on a
Mystro256 2af4dbd
5.0 compatibility feature, and does not require this patch. Since a 0.10.3
Mystro256 2af4dbd
release seems unlikely at this point, this commit is mostly targeted at future
Mystro256 2af4dbd
packagers of older love versions.
Mystro256 2af4dbd
Mystro256 2af4dbd
diff --git a/src/libraries/luasocket/libluasocket/lua.h b/src/libraries/luasocket/libluasocket/lua.h
Mystro256 2af4dbd
--- a/src/libraries/luasocket/libluasocket/lua.h
Mystro256 2af4dbd
+++ b/src/libraries/luasocket/libluasocket/lua.h
Mystro256 2af4dbd
@@ -6,9 +6,12 @@
Mystro256 2af4dbd
 #include <lualib.h>
Mystro256 2af4dbd
 #include <lauxlib.h>
Mystro256 2af4dbd
 
Mystro256 2af4dbd
-#if LUA_VERSION_NUM > 501
Mystro256 2af4dbd
+#if LUA_VERSION_NUM >= 501
Mystro256 2af4dbd
+#	undef luaL_reg
Mystro256 2af4dbd
 #	define luaL_reg luaL_Reg
Mystro256 2af4dbd
+#	undef luaL_putchar
Mystro256 2af4dbd
 #	define luaL_putchar(B, c) luaL_addchar(B, c)
Mystro256 2af4dbd
+#	undef luaL_typerror
Mystro256 2af4dbd
 #	define luaL_typerror(L, n, t) luax_typerror(L, n, t)
Mystro256 2af4dbd
 
Mystro256 2af4dbd
 extern int luax_typerror(lua_State *L, int narg, const char *type);