Skip to content

Commit 6551f2f

Browse files
committed
wrapper: don't assume linux === glibc (updates #55)
1 parent fc4bac7 commit 6551f2f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/gnu_wrapper.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
#include <stdio.h>
1414
#include <stdlib.h>
1515
#include <string.h>
16-
#include <sys/cdefs.h>
1716
#include <new>
1817

19-
#include "heaplayers.h"
20-
2118
/*
2219
To use this library,
2320
you only need to define the following allocation functions:
@@ -72,4 +69,7 @@ WEAK_REDEF1(size_t, malloc_usable_size, void *);
7269
}
7370

7471
#include "wrapper.cc"
72+
#ifdef __GLIBC__
73+
// don't do this under musl
7574
#include "wrappers/gnuwrapper-hooks.cpp"
75+
#endif

src/wrapper.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ extern "C" MESH_EXPORT int CUSTOM_MALLOC_SET_STATE(void * /* ptr */) {
217217
return 0; // success.
218218
}
219219

220-
#if defined(__GNUC__) && !defined(__FreeBSD__)
220+
#if defined(__GNUC__) && !defined(__FreeBSD__) && defined(__GLIBC__)
221221
extern "C" MESH_EXPORT struct mallinfo CUSTOM_MALLINFO() {
222222
// For now, we return useless stats.
223223
struct mallinfo m;

0 commit comments

Comments
 (0)