summarylogtreecommitdiffstats
path: root/005-luabind-lua_resume_extra_param.patch
diff options
context:
space:
mode:
authorPitBall2015-11-10 19:49:28 +0100
committerPitBall2015-11-10 19:49:28 +0100
commit3476bcd709cb40bc472b1cdca62ad3cb528a007a (patch)
treedfcf68c4e7a93586f14f7411e463495ceb1ad10f /005-luabind-lua_resume_extra_param.patch
downloadaur-3476bcd709cb40bc472b1cdca62ad3cb528a007a.tar.gz
Initial import
Diffstat (limited to '005-luabind-lua_resume_extra_param.patch')
-rw-r--r--005-luabind-lua_resume_extra_param.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/005-luabind-lua_resume_extra_param.patch b/005-luabind-lua_resume_extra_param.patch
new file mode 100644
index 000000000000..c61dcf2ec810
--- /dev/null
+++ b/005-luabind-lua_resume_extra_param.patch
@@ -0,0 +1,41 @@
+From 6497a5a598e86ee08d4f8a35b68508661bb11617 Mon Sep 17 00:00:00 2001
+From: Peter Colberg <peter.colberg@utoronto.ca>
+Date: Wed, 21 Dec 2011 13:45:38 -0500
+Subject: [PATCH] Lua 5.2: pass extra parameter NULL to lua_resume
+
+http://www.lua.org/manual/5.2/manual.html#8.3
+
+This commit drops support for Lua 5.0, since Luabind is incompatible
+with Lua 5.0 anyway, e.g. commit 7dc37f9 requires lua_Integer added
+in Lua 5.1.
+---
+ src/pcall.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/pcall.cpp b/src/pcall.cpp
+index 66dbeaa..817884c 100755
+--- a/src/pcall.cpp
++++ b/src/pcall.cpp
+@@ -47,14 +47,14 @@
+
+ int resume_impl(lua_State *L, int nargs, int)
+ {
+-#if LUA_VERSION_NUM >= 501
++#if LUA_VERSION_NUM >= 502
++ int res = lua_resume(L, NULL, nargs);
++#else
++ int res = lua_resume(L, nargs);
++#endif
+ // Lua 5.1 added LUA_YIELD as a possible return value,
+ // this was causing crashes, because the caller expects 0 on success.
+- int res = lua_resume(L, nargs);
+ return (res == LUA_YIELD) ? 0 : res;
+-#else
+- return lua_resume(L, nargs);
+-#endif
+ }
+
+ }}
+--
+1.8.1.6
+