Skip to content

Commit

Permalink
make __GLIBC_PREREQ check for mallinfo2 portable
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed May 13, 2021
1 parent 93a87ce commit 27fcfcc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion h_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 27fcfcc

Please sign in to comment.