diff --git a/README.md b/README.md index d26500b..2c8a2f9 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/rockspecs/mtint-0.3.3-1.rockspec b/rockspecs/mtint-0.3.3-1.rockspec new file mode 100644 index 0000000..a4f2d42 --- /dev/null +++ b/rockspecs/mtint-0.3.3-1.rockspec @@ -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 }, + }, + } +} \ No newline at end of file diff --git a/rockspecs/mtint-scm-0.rockspec b/rockspecs/mtint-scm-0.rockspec index d252d2f..fe58d68 100644 --- a/rockspecs/mtint-scm-0.rockspec +++ b/rockspecs/mtint-scm-0.rockspec @@ -16,7 +16,7 @@ description = { ]], } dependencies = { - "lua >= 5.1, < 5.4", + "lua >= 5.1, <= 5.4", } build = { type = "builtin", diff --git a/src/compat-5.3.h b/src/compat-5.3.h index 8e10893..10605d8 100644 --- a/src/compat-5.3.h +++ b/src/compat-5.3.h @@ -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 */