Skip to content

Commit

Permalink
Add FreeBSD support
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Dec 5, 2023
1 parent 6bd95a0 commit c4a1129
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,18 @@ jobs:
cmake -B build
cmake --build build -j $(sysctl -n hw.ncpu)
./build/qjs -qd
freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build + test
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y cmake
run: |
cmake -B build
cmake --build build -j $(sysctl -n hw.ncpu)
./build/qjs -qd
6 changes: 3 additions & 3 deletions quickjs-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@

#if defined(__APPLE__)
typedef sig_t sighandler_t;
#if !defined(environ)
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
#endif
#endif /* __APPLE__ */

#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__FreeBSD__)
typedef sig_t sighandler_t;
extern char **environ;
#endif
Expand Down Expand Up @@ -3591,6 +3589,8 @@ void js_std_set_worker_new_context_func(JSContext *(*func)(JSRuntime *rt))
#define OS_PLATFORM "linux"
#elif defined(__OpenBSD__)
#define OS_PLATFORM "openbsd"
#elif defined(__FreeBSD__)
#define OS_PLATFORM "freebsd"
#else
#define OS_PLATFORM "unknown"
#endif
Expand Down

0 comments on commit c4a1129

Please sign in to comment.