From a875951e825a9b8c4bbcf4e058fa4cc8d92e2935 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 6 Sep 2018 14:35:08 -0400 Subject: [PATCH] fix build with musl --- malloc.c | 2 ++ malloc.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/malloc.c b/malloc.c index 9de8e4a..e4d6c50 100644 --- a/malloc.c +++ b/malloc.c @@ -1049,9 +1049,11 @@ EXPORT int h_malloc_trim(UNUSED size_t pad) { EXPORT void h_malloc_stats(void) {} +#if defined(__GLIBC__) || defined(__ANDROID__) EXPORT struct mallinfo h_mallinfo(void) { return (struct mallinfo){0}; } +#endif EXPORT int h_malloc_info(UNUSED int options, UNUSED FILE *fp) { errno = ENOSYS; diff --git a/malloc.h b/malloc.h index 8f5bbc1..9073c29 100644 --- a/malloc.h +++ b/malloc.h @@ -51,7 +51,9 @@ size_t h_malloc_usable_size(void *ptr); int h_mallopt(int param, int value); int h_malloc_trim(size_t pad); void h_malloc_stats(void); +#if defined(__GLIBC__) || defined(__ANDROID__) struct mallinfo h_mallinfo(void); +#endif int h_malloc_info(int options, FILE *fp); // obsolete glibc extensions