From 27fcfccb6722ca5f31be1a30b6fc5d4d8f863e25 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 12 May 2021 22:53:20 -0400 Subject: [PATCH] make __GLIBC_PREREQ check for mallinfo2 portable --- h_malloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/h_malloc.c b/h_malloc.c index 30813ce..67451bc 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -1797,9 +1797,13 @@ EXPORT void h_malloc_stats(void) {} EXPORT struct mallinfo h_mallinfo(void) { return (struct mallinfo){0}; } + +#if __GLIBC_PREREQ(2, 33) +#define HAVE_MALLINFO2 +#endif #endif -#if (defined(__GLIBC__) && __GLIBC_PREREQ(2, 33)) || defined(__ANDROID__) +#if defined(HAVE_MALLINFO2) || defined(__ANDROID__) #ifndef __GLIBC__ EXPORT struct mallinfo h_mallinfo(void) { struct mallinfo info = {0};