dovecot-2.0: Don't include malloc.h if it doesn't have malloc_us...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jul 27 03:59:47 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/462dcad58a92
changeset: 9668:462dcad58a92
user: Timo Sirainen <tss at iki.fi>
date: Sun Jul 26 20:13:18 2009 -0400
description:
Don't include malloc.h if it doesn't have malloc_usable_size().
diffstat:
2 files changed, 13 insertions(+), 11 deletions(-)
src/lib/mempool-system-clean.c | 13 +++++++------
src/lib/mempool-system.c | 11 ++++++-----
diffs (45 lines):
diff -r 4fdc1fadb529 -r 462dcad58a92 src/lib/mempool-system-clean.c
--- a/src/lib/mempool-system-clean.c Sun Jul 26 20:03:41 2009 -0400
+++ b/src/lib/mempool-system-clean.c Sun Jul 26 20:13:18 2009 -0400
@@ -6,13 +6,14 @@
#include "safe-memset.h"
#include "mempool.h"
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
+#include <stdlib.h>
+#ifndef HAVE_MALLOC_USABLE_SIZE
+/* no extra includes needed */
+#elif defined (HAVE_MALLOC_NP_H)
+# include <malloc_np.h> /* FreeBSD */
+#elif defined (HAVE_MALLOC_H)
+# include <malloc.h> /* Linux */
#endif
-#ifdef HAVE_MALLOC_NP_H
-# include <malloc_np.h> /* for malloc_usable_size() with FreeBSD */
-#endif
-#include <stdlib.h>
#ifdef HAVE_GC_GC_H
# include <gc/gc.h>
diff -r 4fdc1fadb529 -r 462dcad58a92 src/lib/mempool-system.c
--- a/src/lib/mempool-system.c Sun Jul 26 20:03:41 2009 -0400
+++ b/src/lib/mempool-system.c Sun Jul 26 20:13:18 2009 -0400
@@ -6,11 +6,12 @@
#include "mempool.h"
#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#ifdef HAVE_MALLOC_NP_H
-# include <malloc_np.h> /* for malloc_usable_size() with FreeBSD */
+#ifndef HAVE_MALLOC_USABLE_SIZE
+/* no extra includes needed */
+#elif defined (HAVE_MALLOC_NP_H)
+# include <malloc_np.h> /* FreeBSD */
+#elif defined (HAVE_MALLOC_H)
+# include <malloc.h> /* Linux */
#endif
#ifdef HAVE_GC_GC_H
More information about the dovecot-cvs
mailing list