Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update lrexlib to rel-2-9-1 #253

Merged
merged 3 commits into from
Jul 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest]
build_type: [tiny, regular-asm]
lua_engine: [LuaJIT, Lua]
env:
BUILD_TYPE: ${{ matrix.build_type }}
WITH_LUA_ENGINE: ${{ matrix.lua_engine }}

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Configure
run: WITHOUT_AMALG=1 make ${BUILD_TYPE}
run: WITHOUT_AMALG=1 make ${BUILD_TYPE} WITH_LUA_ENGINE=${WITH_LUA_ENGINE}

- name: Build
run: make
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ else (WithSharedLibluv)
include_directories(deps/luv/src)
include_directories(deps/luv/deps/libuv/include)
if (WITH_LUA_ENGINE STREQUAL Lua)
include_directories(deps/luv/deps/lua/src)
include_directories(deps/luv/deps/lua)
set(LUVI_LIBRARIES libluv_a lualib uv_a)
else()
include_directories(deps/luv/deps/luajit/src)
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ ifdef WITHOUT_AMALG
CMAKE_FLAGS+= -DWITH_AMALG=OFF
endif

ifdef WITH_LUA_ENGINE
CMAKE_FLAGS+= -DWITH_LUA_ENGINE=$(WITH_LUA_ENGINE)
endif

WITH_SHARED_LIBLUV ?= OFF

CMAKE_FLAGS += \
Expand Down
11 changes: 9 additions & 2 deletions src/luvi_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,30 @@
#define lutf8lib_c

#include "luvi.h"

#if (LUA_VERSION_NUM < 503)
#include "compat-5.3.h"
#include "compat-5.3.c"

#include "lprefix.h"
#include "lstrlib.c"
#include "ltablib.c"
#include "lutf8lib.c"
#endif

#if (LUA_VERSION_NUM == 501)
#ifndef LUA_UTF8LIBNAME
#define LUA_UTF8LIBNAME "utf8"
#endif

#if (LUA_VERSION_NUM == 501)
#ifndef UTF8PATT_501
#define UTF8PATT_501 "[%z\x01-\x7F\xC2-\xF4][\x80-\xBF]*"
#endif
#endif

void luvi_openlibs(lua_State *L) {
luaL_openlibs(L);
#if (LUA_VERSION_NUM!=503)
#if (LUA_VERSION_NUM < 503)
{
static luaL_Reg const funcs[] = {
{ "pack", str_pack },
Expand All @@ -32,7 +35,11 @@ void luvi_openlibs(lua_State *L) {
{ NULL, NULL }
};

#if (LUA_VERSION_NUM > 501)
luaL_newlib(L, funcs);
#else
luaL_register(L, LUA_STRLIBNAME, funcs);
#endif
}
lua_pop(L, 1);

Expand Down
5 changes: 5 additions & 0 deletions src/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "./luvi.h"

#if (LUA_VERSION_NUM > 501)
#define lua_getfenv lua_getuservalue
#define lua_setfenv lua_setuservalue
#endif

#if defined(_MSC_VER) && _MSC_VER < 1900

#define snprintf c99_snprintf
Expand Down