diff --git a/qjs.c b/qjs.c index 0332895..7103e11 100644 --- a/qjs.c +++ b/qjs.c @@ -34,7 +34,7 @@ #include #if defined(__APPLE__) #include -#elif defined(__linux__) +#elif defined(__linux__) || defined(__GLIBC__) #include #elif defined(__FreeBSD__) #include @@ -151,7 +151,7 @@ static size_t js_trace_malloc_usable_size(const void *ptr) return _msize((void *)ptr); #elif defined(EMSCRIPTEN) return 0; -#elif defined(__linux__) +#elif defined(__linux__) || defined(__GLIBC__) return malloc_usable_size((void *)ptr); #else /* change this to `return 0;` if compilation fails */ diff --git a/quickjs.c b/quickjs.c index 3cb2643..642ae34 100644 --- a/quickjs.c +++ b/quickjs.c @@ -34,7 +34,7 @@ #include #if defined(__APPLE__) #include -#elif defined(__linux__) +#elif defined(__linux__) || defined(__GLIBC__) #include #elif defined(__FreeBSD__) #include @@ -1708,7 +1708,7 @@ static size_t js_def_malloc_usable_size(const void *ptr) return _msize((void *)ptr); #elif defined(EMSCRIPTEN) return 0; -#elif defined(__linux__) +#elif defined(__linux__) || defined(__GLIBC__) return malloc_usable_size((void *)ptr); #else /* change this to `return 0;` if compilation fails */