+2010-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Bruno Haible <bruno@clisp.org>
+
+ Make the module 'calloc-gnu' work again on AIX and OSF/1.
+ * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Define HAVE_CALLOC_GNU instead of
+ HAVE_CALLOC.
+ * lib/xmalloc.c: Update accordingly.
+ * lib/calloc.c (NEED_CALLOC_GNU): Enable also when
+ GNULIB_CALLOC_GNU && !HAVE_CALLOC_GNU.
+ * modules/calloc-gnu (configure.ac): Invoke gl_MODULE_INDICATOR.
+
2010-08-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Bruno Haible <bruno@clisp.org>
#include <config.h>
/* Only the AC_FUNC_CALLOC macro defines 'calloc' already in config.h. */
#ifdef calloc
-# define NEED_CALLOC_GNU
+# define NEED_CALLOC_GNU 1
# undef calloc
+/* Whereas the gnulib module 'calloc-gnu' defines HAVE_CALLOC_GNU. */
+#elif GNULIB_CALLOC_GNU && !HAVE_CALLOC_GNU
+# define NEED_CALLOC_GNU 1
#endif
/* Specification. */
{
void *result;
-#ifdef NEED_CALLOC_GNU
+#if NEED_CALLOC_GNU
if (n == 0 || s == 0)
{
n = 1;
/* 1 if calloc is known to be compatible with GNU calloc. This
matters if we are not also using the calloc module, which defines
- HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */
-#if defined HAVE_CALLOC || defined __GLIBC__
+ HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms. */
+#if defined HAVE_CALLOC_GNU || defined __GLIBC__
enum { HAVE_GNU_CALLOC = 1 };
#else
enum { HAVE_GNU_CALLOC = 0 };
-# calloc.m4 serial 10
+# calloc.m4 serial 11
# Copyright (C) 2004-2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
_AC_FUNC_CALLOC_IF(
- [AC_DEFINE([HAVE_CALLOC], [1],
+ [AC_DEFINE([HAVE_CALLOC_GNU], [1],
[Define to 1 if your system has a GNU libc compatible `calloc'
function, and to 0 otherwise.])],
- [AC_DEFINE([HAVE_CALLOC], [0])
+ [AC_DEFINE([HAVE_CALLOC_GNU], [0])
gl_REPLACE_CALLOC
])
])# gl_FUNC_CALLOC_GNU
configure.ac:
gl_FUNC_CALLOC_GNU
+gl_MODULE_INDICATOR([calloc-gnu])
Makefile.am: