Skip to content
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ jobs:
fail-fast: false
matrix:
lua: [lua=5.1, lua=5.2, lua=5.3, lua=5.4, luajit=2.0, luajit=2.1]
target: [mingw,vs]
runs-on: windows-2022
steps:
# Checks-out the repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v4
- name: Install Lua (${{ matrix.lua }})
run: |
pip install hererocks
hererocks lua_install -r@3a142ce --${{ matrix.lua }}
hererocks lua_install -r@28f9d98 --${{ matrix.lua }} --target ${{ matrix.target }}
- name: Build lua-simdjson
run: |
.\lua_install\bin\activate
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ test/
*.o
*.d
*.src.rock

# msvc
*.obj
*.lib
*.exp
27 changes: 27 additions & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
OBJ = src/hxluasimdjson.obj src/simdjson.obj
CPPFLAGS = -I$(LUA_INCDIR)
CXXFLAGS = -EHsc -std:c++17 $(CFLAGS)
LDFLAGS = $(LIBFLAG)

!ifdef LUA_LIBDIR
LDLIBS = $(LUA_LIBDIR)/$(LUALIB)
!endif

TARGET = hxsimdjson.dll

all: $(TARGET)

src/hxluasimdjson.obj: src/hxluasimdjson.h src/simdjson.h
src/simdjson.obj: src/simdjson.h

.cpp.obj::
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -Fo:"src\\"

$(TARGET): $(OBJ)
$(LD) $(LDFLAGS) $** -out:$@ $(LDLIBS)

clean:
del *.dll src\*.obj *.lib *.exp 2>nul

install: $(TARGET)
copy $(TARGET) $(INST_LIBDIR)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package="hx-lua-simdjson"
version="0.0.5-1"
version="0.0.7-1"
source = {
url = "git://github.com/HaxeFoundation/hx-lua-simdjson",
tag = "0.0.5"
tag = "0.0.7"
}
description = {
summary = "This is a simple Haxe-specific Lua binding for simdjson",
Expand Down Expand Up @@ -36,6 +36,7 @@ build = {
build_variables = {
LUA_LIBDIR="$(LUA_LIBDIR)",
LUALIB="$(LUALIB)",
LD="$(LD)",
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package="hx-lua-simdjson"
version="scm-0"
version="scm-1"
source = {
url = "git://github.com/HaxeFoudnation/hx-lua-simdjson",
tag = "0.0.0"
}
description = {
summary = "This is a simple Haxe-specific Lua binding for simdjson",
Expand Down Expand Up @@ -36,6 +35,7 @@ build = {
build_variables = {
LUA_LIBDIR="$(LUA_LIBDIR)",
LUALIB="$(LUALIB)",
LD="$(LD)",
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/hxluasimdjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "hxluasimdjson.h"

#define LUA_SIMDJSON_NAME "hxsimdjson"
#define LUA_SIMDJSON_VERSION "0.0.5"
#define LUA_SIMDJSON_VERSION "0.0.7"

using namespace simdjson;

Expand Down Expand Up @@ -136,9 +136,6 @@ void convert_ondemand_element_to_table(lua_State *L, T& element) {
// calling is_null().value() will trigger an exception if the value is invalid
if (element.is_null().value()) {
lua_pushnil(L);
} else {
// workaround for simdjson 3.10.1
throw simdjson_error(INCORRECT_TYPE);
}
break;
}
Expand Down
10 changes: 8 additions & 2 deletions src/hxluasimdjson.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#include <lua.hpp>

#ifdef _MSC_VER
#define LUASIMDJSON_EXPORT __declspec(dllexport)
#else
#define LUASIMDJSON_EXPORT extern
#endif

extern "C" {
static int parse(lua_State*);
static int parse_file(lua_State*);
static int active_implementation(lua_State*);
static int ParsedObject_open(lua_State*);
static int ParsedObject_open_file(lua_State*);


static const struct luaL_Reg hxluasimdjson[] = {
{"parse", parse},
{"parseFile", parse_file},
Expand All @@ -16,5 +22,5 @@ extern "C" {

{NULL, NULL},
};
int luaopen_hxsimdjson (lua_State*);
LUASIMDJSON_EXPORT int luaopen_hxsimdjson(lua_State*);
}
Loading