Skip to content

Commit 8187d84

Browse files
committed
QuickJS Patch: BSD compilation fixes
1 parent e094902 commit 8187d84

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

quickjs/quickjs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include <math.h>
4242
#if defined(__APPLE__)
4343
#include <malloc/malloc.h>
44-
#elif defined(__linux__) || defined(__GLIBC__)
44+
#elif defined(__linux__) || defined(__GLIBC__) || defined(__ANDROID__)
4545
#include <malloc.h>
4646
#elif defined(__FreeBSD__)
4747
#include <malloc_np.h>
@@ -1754,9 +1754,9 @@ static size_t js_def_malloc_usable_size(const void *ptr)
17541754
return malloc_size(ptr);
17551755
#elif defined(_WIN32)
17561756
return _msize((void *)ptr);
1757-
#elif defined(EMSCRIPTEN)
1757+
#elif defined(EMSCRIPTEN) || defined(__OpenBSD__) || defined(__NetBSD__)
17581758
return 0;
1759-
#elif defined(__linux__) || defined(__GLIBC__)
1759+
#elif defined(__linux__) || defined(__ANDROID__) || defined(__FreeBSD__) || defined(__GLIBC__)
17601760
return malloc_usable_size((void *)ptr);
17611761
#else
17621762
/* change this to `return 0;` if compilation fails */

0 commit comments

Comments
 (0)