mirror of
https://github.com/walterschell/Lua.git
synced 2024-11-23 21:54:35 +00:00
commit
91812f760a
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(lua LANGUAGES C VERSION 5.4.5)
|
||||
project(lua LANGUAGES C VERSION 5.4.6)
|
||||
|
||||
option(LUA_SUPPORT_DL "Support dynamic loading of compiled modules" OFF)
|
||||
option(LUA_BUILD_AS_CXX "Build lua as C++" OFF)
|
||||
@ -25,8 +25,8 @@ else()
|
||||
option(LUA_BUILD_COMPILER "Build luac compiler" ON)
|
||||
endif()
|
||||
|
||||
add_subdirectory(lua-5.4.5)
|
||||
add_subdirectory(lua-${CMAKE_PROJECT_VERSION})
|
||||
|
||||
if(LUA_ENABLE_TESTING)
|
||||
add_test(NAME lua-testsuite COMMAND lua -e "_U=true" all.lua WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lua-5.4.5-tests)
|
||||
add_test(NAME lua-testsuite COMMAND lua -e "_U=true" all.lua WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lua-${CMAKE_PROJECT_VERSION}-tests)
|
||||
endif()
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Lua
|
||||
CMake based build of Lua 5.4.5
|
||||
CMake based build of Lua 5.4.6
|
||||
| Build as C | Build as C++ |
|
||||
| --: | --: |
|
||||
| ![Build Linux](https://github.com/walterschell/Lua/actions/workflows/build-linux.yml/badge.svg?branch=master) | ![Build Linux as C++](https://github.com/walterschell/Lua/actions/workflows/build-linux-cxx.yml/badge.svg?branch=master) |
|
||||
@ -13,6 +13,3 @@ add_subdirectory(lua)
|
||||
...
|
||||
target_link_libraries(<YOURTARGET> lua_static)
|
||||
```
|
||||
|
||||
# Important Note:
|
||||
Depending on your use case, Lua v5.4.5 is API and ABI incompatible with v5.4.1-v5.4.4. A second parameter has been added to `lua_resetthread()`. See https://marc.info/?t=168182290600001&r=1&w=2 for more details.
|
@ -1533,7 +1533,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
|
||||
lua_newthread(L1);
|
||||
}
|
||||
else if EQ("resetthread") {
|
||||
lua_pushinteger(L1, lua_resetthread(L1, L));
|
||||
lua_pushinteger(L1, lua_resetthread(L1)); /* deprecated */
|
||||
}
|
||||
else if EQ("newuserdata") {
|
||||
lua_newuserdata(L1, getnum);
|
@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1
|
||||
|
||||
# Lua version and release.
|
||||
V= 5.4
|
||||
R= $V.5
|
||||
R= $V.6
|
||||
|
||||
# Targets start here.
|
||||
all: $(PLAT)
|
@ -1,5 +1,5 @@
|
||||
|
||||
This is Lua 5.4.5, released on 18 Apr 2023.
|
||||
This is Lua 5.4.6, released on 02 May 2023.
|
||||
|
||||
For installation instructions, license details, and
|
||||
further information about Lua, see doc/readme.html.
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
@ -3846,6 +3846,35 @@ when called through this function.
|
||||
|
||||
|
||||
|
||||
<hr><h3><a name="lua_closethread"><code>lua_closethread</code></a></h3><p>
|
||||
<span class="apii">[-0, +?, –]</span>
|
||||
<pre>int lua_closethread (lua_State *L, lua_State *from);</pre>
|
||||
|
||||
<p>
|
||||
Resets a thread, cleaning its call stack and closing all pending
|
||||
to-be-closed variables.
|
||||
Returns a status code:
|
||||
<a href="#pdf-LUA_OK"><code>LUA_OK</code></a> for no errors in the thread
|
||||
(either the original error that stopped the thread or
|
||||
errors in closing methods),
|
||||
or an error status otherwise.
|
||||
In case of error,
|
||||
leaves the error object on the top of the stack.
|
||||
|
||||
|
||||
<p>
|
||||
The parameter <code>from</code> represents the coroutine that is resetting <code>L</code>.
|
||||
If there is no such coroutine,
|
||||
this parameter can be <code>NULL</code>.
|
||||
|
||||
|
||||
<p>
|
||||
(This function was introduced in release 5.4.6.)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr><h3><a name="lua_compare"><code>lua_compare</code></a></h3><p>
|
||||
<span class="apii">[-0, +0, <em>e</em>]</span>
|
||||
<pre>int lua_compare (lua_State *L, int index1, int index2, int op);</pre>
|
||||
@ -5219,25 +5248,12 @@ and then pops the top element.
|
||||
|
||||
<hr><h3><a name="lua_resetthread"><code>lua_resetthread</code></a></h3><p>
|
||||
<span class="apii">[-0, +?, –]</span>
|
||||
<pre>int lua_resetthread (lua_State *L, lua_State *from);</pre>
|
||||
<pre>int lua_resetthread (lua_State *L);</pre>
|
||||
|
||||
<p>
|
||||
Resets a thread, cleaning its call stack and closing all pending
|
||||
to-be-closed variables.
|
||||
Returns a status code:
|
||||
<a href="#pdf-LUA_OK"><code>LUA_OK</code></a> for no errors in the thread
|
||||
(either the original error that stopped the thread or
|
||||
errors in closing methods),
|
||||
or an error status otherwise.
|
||||
In case of error,
|
||||
leaves the error object on the top of the stack.
|
||||
|
||||
|
||||
<p>
|
||||
The parameter <code>from</code> represents the coroutine that is resetting <code>L</code>.
|
||||
If there is no such coroutine,
|
||||
this parameter can be <code>NULL</code>.
|
||||
(This parameter was introduced in release 5.4.5.)
|
||||
This function is deprecated;
|
||||
it is equivalent to <a href="#lua_closethread"><code>lua_closethread</code></a> with
|
||||
<code>from</code> being <code>NULL</code>.
|
||||
|
||||
|
||||
|
||||
@ -12020,10 +12036,10 @@ and LiteralString, see <a href="#3.1">§3.1</a>.)
|
||||
|
||||
<P CLASS="footer">
|
||||
Last update:
|
||||
Tue Apr 18 12:51:25 UTC 2023
|
||||
Tue May 2 20:09:38 UTC 2023
|
||||
</P>
|
||||
<!--
|
||||
Last change: revised for Lua 5.4.5
|
||||
Last change: revised for Lua 5.4.6
|
||||
-->
|
||||
|
||||
</body></html>
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@ -107,7 +107,7 @@ Here are the details.
|
||||
<OL>
|
||||
<LI>
|
||||
Open a terminal window and move to
|
||||
the top-level directory, which is named <TT>lua-5.4.5</TT>.
|
||||
the top-level directory, which is named <TT>lua-5.4.6</TT>.
|
||||
The <TT>Makefile</TT> there controls both the build process and the installation process.
|
||||
<P>
|
||||
<LI>
|
||||
@ -327,10 +327,10 @@ THE SOFTWARE.
|
||||
|
||||
<P CLASS="footer">
|
||||
Last update:
|
||||
Mon Mar 27 21:22:06 UTC 2023
|
||||
Tue May 2 20:08:55 UTC 2023
|
||||
</P>
|
||||
<!--
|
||||
Last change: revised for Lua 5.4.5
|
||||
Last change: revised for Lua 5.4.6
|
||||
-->
|
||||
|
||||
</BODY>
|
@ -18,10 +18,10 @@
|
||||
|
||||
#define LUA_VERSION_MAJOR "5"
|
||||
#define LUA_VERSION_MINOR "4"
|
||||
#define LUA_VERSION_RELEASE "5"
|
||||
#define LUA_VERSION_RELEASE "6"
|
||||
|
||||
#define LUA_VERSION_NUM 504
|
||||
#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 5)
|
||||
#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 6)
|
||||
|
||||
#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
|
||||
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
|
||||
@ -163,7 +163,8 @@ extern const char lua_ident[];
|
||||
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
|
||||
LUA_API void (lua_close) (lua_State *L);
|
||||
LUA_API lua_State *(lua_newthread) (lua_State *L);
|
||||
LUA_API int (lua_resetthread) (lua_State *L, lua_State *from);
|
||||
LUA_API int (lua_closethread) (lua_State *L, lua_State *from);
|
||||
LUA_API int (lua_resetthread) (lua_State *L); /* Deprecated! */
|
||||
|
||||
LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
|
||||
|
@ -76,7 +76,7 @@ static int luaB_auxwrap (lua_State *L) {
|
||||
if (l_unlikely(r < 0)) { /* error? */
|
||||
int stat = lua_status(co);
|
||||
if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */
|
||||
stat = lua_resetthread(co, L); /* close its tbc variables */
|
||||
stat = lua_closethread(co, L); /* close its tbc variables */
|
||||
lua_assert(stat != LUA_OK);
|
||||
lua_xmove(co, L, 1); /* move error message to the caller */
|
||||
}
|
||||
@ -172,7 +172,7 @@ static int luaB_close (lua_State *L) {
|
||||
int status = auxstatus(L, co);
|
||||
switch (status) {
|
||||
case COS_DEAD: case COS_YIELD: {
|
||||
status = lua_resetthread(co, L);
|
||||
status = lua_closethread(co, L);
|
||||
if (status == LUA_OK) {
|
||||
lua_pushboolean(L, 1);
|
||||
return 1;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user