1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

Make the module 'malloc-gnu' work again on AIX and OSF/1.

This commit is contained in:
Bruno Haible
2010-08-29 19:20:47 +02:00
parent ef6f425ed1
commit 560be60e7e
4 changed files with 19 additions and 6 deletions

View File

@@ -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.

View File

@@ -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 @@ rpl_malloc (size_t n)
{
void *result;
#ifdef NEED_MALLOC_GNU
#if NEED_MALLOC_GNU
if (n == 0)
n = 1;
#endif

View 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
])
])

View 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: