File tree 4 files changed +22
-5
lines changed
4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -401,3 +401,18 @@ jobs:
401
401
cmake -B build
402
402
cmake --build build -j $(sysctl -n hw.ncpu)
403
403
./build/qjs -qd
404
+
405
+ freebsd :
406
+ runs-on : ubuntu-latest
407
+ steps :
408
+ - uses : actions/checkout@v3
409
+ - name : build + test
410
+ uses : vmactions/freebsd-vm@v1
411
+ with :
412
+ usesh : true
413
+ prepare : |
414
+ pkg install -y cmake
415
+ run : |
416
+ cmake -B build
417
+ cmake --build build -j $(sysctl -n hw.ncpu)
418
+ ./build/qjs -qd
Original file line number Diff line number Diff line change 38
38
#include <malloc/malloc.h>
39
39
#elif defined(__linux__ ) || defined(__CYGWIN__ )
40
40
#include <malloc.h>
41
+ #elif defined(__FreeBSD__ )
42
+ #include <malloc_np.h>
41
43
#endif
42
44
43
45
#include "cutils.h"
@@ -135,7 +137,7 @@ static inline size_t js_trace_malloc_usable_size(void *ptr)
135
137
return malloc_size (ptr );
136
138
#elif defined(_WIN32 )
137
139
return _msize (ptr );
138
- #elif defined(__linux__ )
140
+ #elif defined(__linux__ ) || defined( __FreeBSD__ )
139
141
return malloc_usable_size (ptr );
140
142
#else
141
143
return 0 ;
Original file line number Diff line number Diff line change 67
67
68
68
#if defined(__APPLE__ )
69
69
typedef sig_t sighandler_t ;
70
- #if !defined(environ )
71
70
#include <crt_externs.h>
72
71
#define environ (*_NSGetEnviron())
73
72
#endif
74
- #endif /* __APPLE__ */
75
73
76
- #if defined(__OpenBSD__ )
74
+ #if defined(__OpenBSD__ ) || defined( __FreeBSD__ )
77
75
typedef sig_t sighandler_t ;
78
76
extern char * * environ ;
79
77
#endif
@@ -3591,6 +3589,8 @@ void js_std_set_worker_new_context_func(JSContext *(*func)(JSRuntime *rt))
3591
3589
#define OS_PLATFORM "linux"
3592
3590
#elif defined(__OpenBSD__ )
3593
3591
#define OS_PLATFORM "openbsd"
3592
+ #elif defined(__FreeBSD__ )
3593
+ #define OS_PLATFORM "freebsd"
3594
3594
#else
3595
3595
#define OS_PLATFORM "unknown"
3596
3596
#endif
Original file line number Diff line number Diff line change @@ -1646,7 +1646,7 @@ static inline size_t js_def_malloc_usable_size(void *ptr)
1646
1646
return malloc_size(ptr);
1647
1647
#elif defined(_WIN32)
1648
1648
return _msize(ptr);
1649
- #elif defined(__linux__)
1649
+ #elif defined(__linux__) || defined(__FreeBSD__)
1650
1650
return malloc_usable_size(ptr);
1651
1651
#else
1652
1652
return 0;
You can’t perform that action at this time.
0 commit comments