Fix FreeBSD build: include malloc.h only when a macro HAVE_MALLOC_H defined

This commit is contained in:
Stas Degteff 2011-02-17 11:18:16 +00:00
parent 043e69a93a
commit 6a6da92414
3 changed files with 3 additions and 5 deletions

View File

@ -32,7 +32,7 @@
/* ------------------------------------------------------------------ */
#include <stdlib.h>
#if !defined(__APPLE__)
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include <string.h>

View File

@ -35,9 +35,7 @@
#include <stdlib.h>
#include <string.h>
/* FreeBSD's malloc.h is deprecated, it drops a warning and */
/* #includes <stdlib.h>, which is already here. */
#if !defined(__FreeBSD__) && !defined(__APPLE__)
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif

View File

@ -49,7 +49,7 @@
/* ANSI C Library headers */
#if !defined(__FreeBSD__) && !defined(__APPLE__)
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif