From: Paul Jakma Date: Sun, 28 May 2006 08:15:46 +0000 (+0000) Subject: [lib] malloc.h is deprecated, try not to include it anymore X-Git-Tag: frr-2.0-rc1~2680 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d09552d0c7d389f83c3833bf82f7a97da37007da;p=mirror%2Ffrr.git [lib] malloc.h is deprecated, try not to include it anymore 2006-05-28 Paul Jakma * memory.c: malloc.h is deprecated in favour of stdlib.h, however we still need it on GNU Libc for mallinfo(). --- diff --git a/lib/ChangeLog b/lib/ChangeLog index b857b135f4..08131b031a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -3,6 +3,8 @@ * zebra.h: Include inttypes.h rather than stdint.h, best practice according to the autoconf manual. Add UINT*_MAX defines for older platforms lacking these (FBSD 4) + * memory.c: malloc.h is deprecated in favour of stdlib.h, however + we still need it on GNU Libc for mallinfo(). 2006-05-21 Andrew J. Schorr diff --git a/lib/memory.c b/lib/memory.c index 802c07f290..1141e40570 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -21,7 +21,10 @@ */ #include +/* malloc.h is generally obsolete, however GNU Libc mallinfo wants it. */ +#if defined(HAVE_STDLIB_H) || (defined(GNU_LINUX) && defined(HAVE_MALLINFO)) #include +#endif /* !HAVE_STDLIB_H || HAVE_MALLINFO */ #include "log.h" #include "memory.h"