Make the module 'malloc-gnu' work again on AIX and OSF/1.
authorBruno Haible <bruno@clisp.org>
Sun, 29 Aug 2010 17:20:47 +0000 (19:20 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 29 Aug 2010 19:03:20 +0000 (21:03 +0200)
ChangeLog
lib/malloc.c
m4/malloc.m4
modules/malloc-gnu

index a4be390c2f45a8d8a350394e83d2f086810a0424..0172e4784f89dbf8513c319d575b5b68ca72b1b6 100644 (file)
--- 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.
index f236f372149ef5c67c2e72aaedc9012b5519ec4f..8f849b410a75fbb7cef1419259339cb76ee6f9d8 100644 (file)
 #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 @@ rpl_malloc (size_t n)
 {
   void *result;
 
-#ifdef NEED_MALLOC_GNU
+#if NEED_MALLOC_GNU
   if (n == 0)
     n = 1;
 #endif
index 56fd25e8b6bd81532e2fbdd3c2831da20abc1300..7a749254a1f9c3cd21f873592cc0b3a3a49c579d 100644 (file)
@@ -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_DEFUN([gl_FUNC_MALLOC_GNU],
   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
     ])
 ])
index eb6ab6ac38b09678a5502f4e6f36514fe7cdce73..7cb21b8d37e55352d6d09ba9968771132b960096 100644 (file)
@@ -14,7 +14,7 @@ malloc-posix
 
 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: