xref: /OK3568_Linux_fs/buildroot/package/copas/0001-Do-not-load-coxpcall-for-LuaJIT.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom 8d1b5a9b973a9891d676dabf31807eb825d7f262 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: =?UTF-8?q?Fran=C3=A7ois=20Perrad?= <francois.perrad@gadz.org>
3*4882a593SmuzhiyunDate: Wed, 6 Sep 2017 00:00:56 +0200
4*4882a593SmuzhiyunSubject: [PATCH] Do not load coxpcall for LuaJIT
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun* coxpcall is only required with PUC Lua 5.1, but not with LuaJIT
7*4882a593Smuzhiyun
8*4882a593Smuzhiyunuse the same logic as in copas.lua.
9*4882a593Smuzhiyunthis fixes issue #63.
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunFetch from: https://github.com/keplerproject/copas/commit/8d1b5a9b973a9891d676dabf31807eb825d7f262
12*4882a593SmuzhiyunSigned-off-by: Francois Perrad <francois.perrad@gadz.org>
13*4882a593Smuzhiyun---
14*4882a593Smuzhiyun doc/us/index.html   | 5 +++++
15*4882a593Smuzhiyun src/copas/limit.lua | 2 +-
16*4882a593Smuzhiyun 2 files changed, 6 insertions(+), 1 deletion(-)
17*4882a593Smuzhiyun
18*4882a593Smuzhiyundiff --git a/copas-2_0_2/doc/us/index.html b/doc/us/index.html
19*4882a593Smuzhiyunindex 1d008c2..c4d85ef 100644
20*4882a593Smuzhiyun--- a/copas-2_0_2/doc/us/index.html
21*4882a593Smuzhiyun+++ b/copas-2_0_2/doc/us/index.html
22*4882a593Smuzhiyun@@ -114,6 +114,11 @@ LuaSocket, <a href="http://keplerproject.github.io/coxpcall/">Coxpcall</a> (only
23*4882a593Smuzhiyun <h2><a name="history"></a>History</h2>
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun <dl class="history">
26*4882a593Smuzhiyun+    <dt><strong>Copas</strong> [unreleased]</dt>
27*4882a593Smuzhiyun+	<dd><ul>
28*4882a593Smuzhiyun+                <li>Fixed: coxpcall dependency in limit.lua #63 (Francois Perrad)</li>
29*4882a593Smuzhiyun+	</ul></dd>
30*4882a593Smuzhiyun+
31*4882a593Smuzhiyun     <dt><strong>Copas 2.0.2</strong> [2017]</dt>
32*4882a593Smuzhiyun 	<dd><ul>
33*4882a593Smuzhiyun 		<li>Added: <code>copas.running</code> flag</li>
34*4882a593Smuzhiyundiff --git a/copas-2_0_2/src/copas/limit.lua b/src/copas/limit.lua
35*4882a593Smuzhiyunindex ea178be..f0dfe17 100644
36*4882a593Smuzhiyun--- a/copas-2_0_2/src/copas/limit.lua
37*4882a593Smuzhiyun+++ b/copas-2_0_2/src/copas/limit.lua
38*4882a593Smuzhiyun@@ -10,7 +10,7 @@ local pack = table.pack or function(...) return {n=select('#',...),...} end
39*4882a593Smuzhiyun local unpack = function(t) return (table.unpack or unpack)(t, 1, t.n or #t) end
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun local pcall = pcall
42*4882a593Smuzhiyun-if _VERSION=="Lua 5.1" then     -- obsolete: only for Lua 5.1 compatibility
43*4882a593Smuzhiyun+if _VERSION=="Lua 5.1" and not jit then     -- obsolete: only for Lua 5.1 compatibility
44*4882a593Smuzhiyun   pcall = require("coxpcall").pcall
45*4882a593Smuzhiyun end
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun--
48*4882a593Smuzhiyun2.17.1
49*4882a593Smuzhiyun
50