[git commit master 1/1] add if guards around include <malloc.h>

Denys Vlasenko vda.linux at googlemail.com
Sun Dec 5 00:30:14 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=8da415ef2503936bc9730f78a25b00177ff2db1d
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/appletlib.c |    6 +++++-
 shell/hush.c      |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index efd7a5a..3e32fa1 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -28,7 +28,11 @@
  */
 #include "busybox.h"
 #include <assert.h>
-#include <malloc.h>
+#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
+        || defined(__APPLE__) \
+    )
+# include <malloc.h> /* for mallopt */
+#endif
 /* Try to pull in PAGE_SIZE */
 #ifdef __linux__
 # include <sys/user.h>
diff --git a/shell/hush.c b/shell/hush.c
index 584af9e..087636b 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -82,7 +82,11 @@
  *              aaa
  */
 #include "busybox.h"  /* for APPLET_IS_NOFORK/NOEXEC */
-#include <malloc.h>   /* for malloc_trim */
+#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
+	|| defined(__APPLE__) \
+    )
+# include <malloc.h>   /* for malloc_trim */
+#endif
 #include <glob.h>
 /* #include <dmalloc.h> */
 #if ENABLE_HUSH_CASE
-- 
1.7.2.2



More information about the busybox-cvs mailing list