Skip to content

Commit

Permalink
Support for Lua 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
osch committed Jul 29, 2020
1 parent 0a27c49 commit 2fbf82d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ See below for full [reference documentation](#documentation).
* Other Unix variants: could work, but untested, required are:
* gcc atomic builtins or C11 `stdatomic.h`
* `pthread.h` or C11 `threads.h`
* Tested Lua versions: 5.1, 5.2, 5.3, luajit 2.0 & 2.1
* Lua 5.2 & 5.3: full support, main states and coroutines are interruptible.
* Tested Lua versions: 5.1, 5.2, 5.3, 5.4, luajit 2.0 & 2.1
* Lua 5.2 - 5.4: full support, main states and coroutines are interruptible.
* Lua 5.1: coroutines cannot be interrupted, only main states.
* LuaJIT: same restrictions than Lua 5.1, JIT compiled pure machine code
not considering the debug hook cannot be interrupted.
Expand Down
53 changes: 53 additions & 0 deletions rockspecs/mtint-0.3.3-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package = "mtint"
version = "0.3.3-1"
local versionNumber = version:gsub("^(.*)-.-$", "%1")
source = {
url = "https://github.com/osch/lua-mtint/archive/v"..versionNumber..".zip",
dir = "lua-mtint-"..versionNumber,
}
description = {
summary = "Make threads and coroutines interruptible",
homepage = "https://github.com/osch/lua-mtint",
license = "MIT/X11",
detailed = [[
This package provides a way to make arbitrary Lua interpreter states (i.e. main
states and couroutines) interruptible from concurrently running threads.
The implementation is independent from the underlying threading
library (e.g. Lanes or lua-llthreads2).
]],
}
dependencies = {
"lua >= 5.1, <= 5.4",
}
build = {
type = "builtin",
platforms = {
unix = {
modules = {
mtint = {
libraries = {"pthread"},
}
}
},
windows = {
modules = {
mtint = {
libraries = {"kernel32"},
}
}
}
},
modules = {
mtint = {
sources = {
"src/main.c",
"src/interruptible.c",
"src/error.c",
"src/util.c",
"src/async_util.c",
"src/mtint_compat.c",
},
defines = { "MTINT_VERSION="..versionNumber },
},
}
}
2 changes: 1 addition & 1 deletion rockspecs/mtint-scm-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description = {
]],
}
dependencies = {
"lua >= 5.1, < 5.4",
"lua >= 5.1, <= 5.4",
}
build = {
type = "builtin",
Expand Down
4 changes: 2 additions & 2 deletions src/compat-5.3.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname,


/* other Lua versions */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 503
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504

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

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

Expand Down

0 comments on commit 2fbf82d

Please sign in to comment.