>From 54a82d1e9923255574447423c8f1c90fac8e5934 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 28 Aug 2010 09:21:08 +0200 Subject: [PATCH 4/4] Fix malloc, calloc, and realloc modules for AIX. * lib/calloc.c [!HAVE_CALLOC]: Also define NEED_CALLOC_GNU in this case. * lib/malloc.c [!HAVE_MALLOC]: Also define NEED_MALLOC_GNU in this case. * lib/realloc.c [!HAVE_REALLOC]: Also define NEED_REALLOC_GNU in this case. Also define SYSTEM_MALLOC_GLIBC_COMPATIBLE, if also GNULIB_MALLOC_GNU. Fixes testsuite regressions of GNU M4 branch-1.4 on AIX 5.3 reported by Rainer Tammer. Regression introduced in v0.0-4009-g723fc0b. Signed-off-by: Ralf Wildenhues --- ChangeLog | 12 ++++++++++++ lib/calloc.c | 5 +++-- lib/malloc.c | 5 +++-- lib/realloc.c | 10 ++++++---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 626d8cf..0a6403f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2010-08-28 Ralf Wildenhues + Fix malloc, calloc, and realloc modules for AIX. + * lib/calloc.c [!HAVE_CALLOC]: Also define NEED_CALLOC_GNU + in this case. + * lib/malloc.c [!HAVE_MALLOC]: Also define NEED_MALLOC_GNU + in this case. + * lib/realloc.c [!HAVE_REALLOC]: Also define NEED_REALLOC_GNU + in this case. Also define SYSTEM_MALLOC_GLIBC_COMPATIBLE, + if also GNULIB_MALLOC_GNU. + Fixes testsuite regressions of GNU M4 branch-1.4 on AIX 5.3 + reported by Rainer Tammer. + Regression introduced in v0.0-4009-g723fc0b. + Tests for module 'realloc'. * modules/realloc-tests: New file. * tests/test-realloc.c: New file. diff --git a/lib/calloc.c b/lib/calloc.c index d28e158..a054074 100644 --- a/lib/calloc.c +++ b/lib/calloc.c @@ -18,8 +18,9 @@ /* written by Jim Meyering and Bruno Haible */ #include -/* Only the AC_FUNC_CALLOC macro defines 'calloc' already in config.h. */ -#ifdef calloc +/* The AC_FUNC_CALLOC macro defines 'calloc' already in config.h, + gl_FUNC_CALLOC_GNU instead defines HAVE_CALLOC to 0. */ +#if defined(calloc) || HAVE_CALLOC == 0 # define NEED_CALLOC_GNU # undef calloc #endif diff --git a/lib/malloc.c b/lib/malloc.c index f236f37..2211d96 100644 --- a/lib/malloc.c +++ b/lib/malloc.c @@ -19,8 +19,9 @@ /* written by Jim Meyering and Bruno Haible */ #include -/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ -#ifdef malloc +/* The AC_FUNC_MALLOC macro defines 'malloc' already in config.h, + gl_FUNC_MALLOC_GNU instead defines HAVE_MALLOC to 0. */ +#if defined(malloc) || HAVE_MALLOC == 0 # define NEED_MALLOC_GNU # undef malloc #endif diff --git a/lib/realloc.c b/lib/realloc.c index 36aeecc..5665c71 100644 --- a/lib/realloc.c +++ b/lib/realloc.c @@ -20,14 +20,16 @@ #include -/* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */ -#ifdef realloc +/* The AC_FUNC_REALLOC macro defines 'realloc' already in config.h, + gl_FUNC_REALLOC_GNU instead defines HAVE_REALLOC to 0. */ +#if defined(realloc) || HAVE_REALLOC == 0 # define NEED_REALLOC_GNU 1 #endif /* Infer the properties of the system's malloc function. - Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ -#if GNULIB_MALLOC_GNU && !defined malloc + The AC_FUNC_MALLOC macro defines 'malloc' already in config.h, + gl_FUNC_MALLOC_GNU instead defines HAVE_MALLOC to 0. */ +#if GNULIB_MALLOC_GNU && (!defined malloc || HAVE_MALLOC == 0) # define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1 #endif -- 1.7.2.1.222.g9988