dovecot-1.2: Don't include malloc.h if it doesn't have malloc_us...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jul 27 03:14:04 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/d6fcb6d050ba
changeset: 9254:d6fcb6d050ba
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 45b110c8da62 -r d6fcb6d050ba src/lib/mempool-system-clean.c
--- a/src/lib/mempool-system-clean.c Sun Jul 26 20:01:44 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 45b110c8da62 -r d6fcb6d050ba src/lib/mempool-system.c
--- a/src/lib/mempool-system.c Sun Jul 26 20:01:44 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