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

Add mac arm64 support #87

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
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [linux, macos]
os: [linux, macos, macos-arm64]
lua: [lua=5.1, lua=5.2, lua=5.3, lua=5.4, luajit=2.0, luajit=2.1]
include:
- os: linux
runner: ubuntu-22.04
- os: macos
runner: macos-13
- os: macos-arm64
runner: macos-14
exclude:
- os: macos-arm64
lua: luajit=2.0
name: ${{ matrix.os }} (${{ matrix.lua }})
runs-on: ${{ matrix.runner }}
steps:
Expand Down
8 changes: 4 additions & 4 deletions src/luasimdjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ void convert_ondemand_element_to_table(lua_State *L, ondemand::value element) {
ondemand::number number = element.get_number();
ondemand::number_type number_type = number.get_number_type();
switch (number_type) {
case fallback::number_type::floating_point_number:
case SIMDJSON_BUILTIN_IMPLEMENTATION::number_type::floating_point_number:
lua_pushnumber(L, element.get_double());
break;

case fallback::number_type::signed_integer:
case SIMDJSON_BUILTIN_IMPLEMENTATION::number_type::signed_integer:
lua_pushinteger(L, element.get_int64());
break;

case fallback::number_type::unsigned_integer:
case SIMDJSON_BUILTIN_IMPLEMENTATION::number_type::unsigned_integer:
{
// a uint64 can be greater than an int64, so we must check how large and pass as a number
// if larger but LUA_MAXINTEGER (which is only defined in 5.3+)
Expand All @@ -101,7 +101,7 @@ void convert_ondemand_element_to_table(lua_State *L, ondemand::value element) {
break;
}

case fallback::number_type::big_integer:
case SIMDJSON_BUILTIN_IMPLEMENTATION::number_type::big_integer:
lua_pushnumber(L, element.get_double());
break;
}
Expand Down