summaryrefslogtreecommitdiffstats
path: root/src/luabind-5-lua-resume.patch
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2014-08-22 12:54:36 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2014-08-22 15:39:14 (GMT)
commit22612efbdbdf88bfdf78270d1d97a27f8c111658 (patch)
tree153093b0e205407088230741bd5de6f86c53e3ff /src/luabind-5-lua-resume.patch
parent2722b35587bee4ec2f0c47f9c6f00186e5685ad9 (diff)
downloadmxe-22612efbdbdf88bfdf78270d1d97a27f8c111658.zip
mxe-22612efbdbdf88bfdf78270d1d97a27f8c111658.tar.gz
mxe-22612efbdbdf88bfdf78270d1d97a27f8c111658.tar.bz2
new package luabind
luabind is compatible with Lua 5.1, but MXE Lua is 5.2, so sevaral patches are applied
Diffstat (limited to 'src/luabind-5-lua-resume.patch')
-rw-r--r--src/luabind-5-lua-resume.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/luabind-5-lua-resume.patch b/src/luabind-5-lua-resume.patch
new file mode 100644
index 0000000..7ead13f
--- /dev/null
+++ b/src/luabind-5-lua-resume.patch
@@ -0,0 +1,32 @@
+This file is part of MXE.
+See index.html for further information.
+
+commit 61587d1b0ffa1d08874154fcdaf0644f8b5b2461
+Author: Boris Nagaev <bnagaev@gmail.com>
+Date: Fri Aug 22 16:46:35 2014 +0400
+
+ lua_resume
+
+diff --git a/src/pcall.cpp b/src/pcall.cpp
+index 66dbeaa..7a5d0c2 100755
+--- a/src/pcall.cpp
++++ b/src/pcall.cpp
+@@ -47,6 +47,10 @@ namespace luabind { namespace detail
+
+ int resume_impl(lua_State *L, int nargs, int)
+ {
++#if LUA_VERSION_NUM >= 502
++ int res = lua_resume(L, NULL, nargs);
++ return (res == LUA_YIELD) ? 0 : res;
++#else
+ #if LUA_VERSION_NUM >= 501
+ // Lua 5.1 added LUA_YIELD as a possible return value,
+ // this was causing crashes, because the caller expects 0 on success.
+@@ -55,6 +59,7 @@ namespace luabind { namespace detail
+ #else
+ return lua_resume(L, nargs);
+ #endif
++#endif
+ }
+
+ }}