changeset 13605:fc6aba4c5936

Make the module 'malloc-gnu' work again on AIX and OSF/1.
author Bruno Haible <bruno@clisp.org>
date Sun, 29 Aug 2010 19:20:47 +0200
parents dde5f87ae001
children 81875db181b0
files ChangeLog lib/malloc.c m4/malloc.m4 modules/malloc-gnu
diffstat 4 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-29  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+            Bruno Haible  <bruno@clisp.org>
+
+	Make the module 'malloc-gnu' work again on AIX and OSF/1.
+	* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Define HAVE_MALLOC_GNU instead of
+	HAVE_MALLOC.
+	* lib/malloc.c (NEED_MALLOC_GNU): Enable behaviour also when
+	GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU.
+	* modules/malloc-gnu (configure.ac): Use gl_MODULE_INDICATOR.
+
 2010-08-29  Bruno Haible  <bruno@clisp.org>
 
 	Update modules list.
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -21,8 +21,11 @@
 #include <config.h>
 /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
 #ifdef malloc
-# define NEED_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
 # undef malloc
+/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU.  */
+#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
 #endif
 
 /* Specification.  */
@@ -41,7 +44,7 @@
 {
   void *result;
 
-#ifdef NEED_MALLOC_GNU
+#if NEED_MALLOC_GNU
   if (n == 0)
     n = 1;
 #endif
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 11
+# malloc.m4 serial 12
 dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,10 +13,10 @@
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
   _AC_FUNC_MALLOC_IF(
-    [AC_DEFINE([HAVE_MALLOC], [1],
+    [AC_DEFINE([HAVE_MALLOC_GNU], [1],
                [Define to 1 if your system has a GNU libc compatible 'malloc'
                 function, and to 0 otherwise.])],
-    [AC_DEFINE([HAVE_MALLOC], [0])
+    [AC_DEFINE([HAVE_MALLOC_GNU], [0])
      gl_REPLACE_MALLOC
     ])
 ])
--- a/modules/malloc-gnu
+++ b/modules/malloc-gnu
@@ -14,7 +14,7 @@
 
 configure.ac:
 gl_FUNC_MALLOC_GNU
-AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
+gl_MODULE_INDICATOR([malloc-gnu])
 
 Makefile.am: