Skip to content

Commit 2fbf82d

Browse files
committed
Support for Lua 5.4
1 parent 0a27c49 commit 2fbf82d

File tree

4 files changed

+58
-5
lines changed

4 files changed

+58
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ See below for full [reference documentation](#documentation).
3434
* Other Unix variants: could work, but untested, required are:
3535
* gcc atomic builtins or C11 `stdatomic.h`
3636
* `pthread.h` or C11 `threads.h`
37-
* Tested Lua versions: 5.1, 5.2, 5.3, luajit 2.0 & 2.1
38-
* Lua 5.2 & 5.3: full support, main states and coroutines are interruptible.
37+
* Tested Lua versions: 5.1, 5.2, 5.3, 5.4, luajit 2.0 & 2.1
38+
* Lua 5.2 - 5.4: full support, main states and coroutines are interruptible.
3939
* Lua 5.1: coroutines cannot be interrupted, only main states.
4040
* LuaJIT: same restrictions than Lua 5.1, JIT compiled pure machine code
4141
not considering the debug hook cannot be interrupted.

rockspecs/mtint-0.3.3-1.rockspec

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package = "mtint"
2+
version = "0.3.3-1"
3+
local versionNumber = version:gsub("^(.*)-.-$", "%1")
4+
source = {
5+
url = "https://github.com/osch/lua-mtint/archive/v"..versionNumber..".zip",
6+
dir = "lua-mtint-"..versionNumber,
7+
}
8+
description = {
9+
summary = "Make threads and coroutines interruptible",
10+
homepage = "https://github.com/osch/lua-mtint",
11+
license = "MIT/X11",
12+
detailed = [[
13+
This package provides a way to make arbitrary Lua interpreter states (i.e. main
14+
states and couroutines) interruptible from concurrently running threads.
15+
The implementation is independent from the underlying threading
16+
library (e.g. Lanes or lua-llthreads2).
17+
]],
18+
}
19+
dependencies = {
20+
"lua >= 5.1, <= 5.4",
21+
}
22+
build = {
23+
type = "builtin",
24+
platforms = {
25+
unix = {
26+
modules = {
27+
mtint = {
28+
libraries = {"pthread"},
29+
}
30+
}
31+
},
32+
windows = {
33+
modules = {
34+
mtint = {
35+
libraries = {"kernel32"},
36+
}
37+
}
38+
}
39+
},
40+
modules = {
41+
mtint = {
42+
sources = {
43+
"src/main.c",
44+
"src/interruptible.c",
45+
"src/error.c",
46+
"src/util.c",
47+
"src/async_util.c",
48+
"src/mtint_compat.c",
49+
},
50+
defines = { "MTINT_VERSION="..versionNumber },
51+
},
52+
}
53+
}

rockspecs/mtint-scm-0.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ description = {
1616
]],
1717
}
1818
dependencies = {
19-
"lua >= 5.1, < 5.4",
19+
"lua >= 5.1, <= 5.4",
2020
}
2121
build = {
2222
type = "builtin",

src/compat-5.3.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname,
397397

398398

399399
/* other Lua versions */
400-
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 503
400+
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504
401401

402-
# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)"
402+
# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3 or 5.4)"
403403

404404
#endif /* other Lua versions except 5.1, 5.2, and 5.3 */
405405

0 commit comments

Comments
 (0)