make __GLIBC_PREREQ check for mallinfo2 portable

pull/138/head 8
Daniel Micay 2021-05-12 22:53:20 -04:00
parent 93a87ce30b
commit 27fcfccb67
1 changed files with 5 additions and 1 deletions

View File

@ -1797,9 +1797,13 @@ EXPORT void h_malloc_stats(void) {}
EXPORT struct mallinfo h_mallinfo(void) { EXPORT struct mallinfo h_mallinfo(void) {
return (struct mallinfo){0}; return (struct mallinfo){0};
} }
#if __GLIBC_PREREQ(2, 33)
#define HAVE_MALLINFO2
#endif
#endif #endif
#if (defined(__GLIBC__) && __GLIBC_PREREQ(2, 33)) || defined(__ANDROID__) #if defined(HAVE_MALLINFO2) || defined(__ANDROID__)
#ifndef __GLIBC__ #ifndef __GLIBC__
EXPORT struct mallinfo h_mallinfo(void) { EXPORT struct mallinfo h_mallinfo(void) {
struct mallinfo info = {0}; struct mallinfo info = {0};