From: Bruno Haible Date: Sun, 29 Aug 2010 17:20:47 +0000 (+0200) Subject: Make the module 'malloc-gnu' work again on AIX and OSF/1. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=560be60e7e4f34d4d07a74eb950f70d0774626a9;p=pspp Make the module 'malloc-gnu' work again on AIX and OSF/1. --- diff --git a/ChangeLog b/ChangeLog index a4be390c2f..0172e4784f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-08-29 Ralf Wildenhues + Bruno Haible + + 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 Update modules list. diff --git a/lib/malloc.c b/lib/malloc.c index f236f37214..8f849b410a 100644 --- a/lib/malloc.c +++ b/lib/malloc.c @@ -21,8 +21,11 @@ #include /* 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 diff --git a/m4/malloc.m4 b/m4/malloc.m4 index 56fd25e8b6..7a749254a1 100644 --- 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_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 ]) ]) diff --git a/modules/malloc-gnu b/modules/malloc-gnu index eb6ab6ac38..7cb21b8d37 100644 --- a/modules/malloc-gnu +++ b/modules/malloc-gnu @@ -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: