From: Bruno Haible Date: Tue, 5 Nov 2024 14:30:49 +0000 (+0100) Subject: calloc: Fix configure test (regression yesterday). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=46d0d94c02e963359f6732cca23a51ea7ca75d7c;p=gnulib.git calloc: Fix configure test (regression yesterday). * m4/calloc.m4 (gl_FUNC_CALLOC_IF): Fix wrong cache variable name. Rename cache variable. Restore earlier comment. --- diff --git a/ChangeLog b/ChangeLog index 89cc5a95a7..0d9114ca3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-11-05 Bruno Haible + + calloc: Fix configure test (regression yesterday). + * m4/calloc.m4 (gl_FUNC_CALLOC_IF): Fix wrong cache variable name. + Rename cache variable. Restore earlier comment. + 2024-11-04 Paul Eggert safe-alloc: simplify, given new reallocarray behavior diff --git a/m4/calloc.m4 b/m4/calloc.m4 index 6514bd1cf9..a4a006e3d9 100644 --- a/m4/calloc.m4 +++ b/m4/calloc.m4 @@ -1,5 +1,5 @@ # calloc.m4 -# serial 35 +# serial 36 dnl Copyright (C) 2004-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ AC_DEFUN([gl_FUNC_CALLOC_IF], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether calloc (0, n) and calloc (n, 0) return nonnull], - [ac_cv_func_calloc_0_nonnull], + [gl_cv_func_calloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include @@ -31,17 +31,17 @@ AC_DEFUN([gl_FUNC_CALLOC_IF], int result = !p; free (p); return result;]])], - [ac_cv_func_calloc_0_nonnull=yes], - [ac_cv_func_calloc_0_nonnull=no], + [gl_cv_func_calloc_0_nonnull=yes], + [gl_cv_func_calloc_0_nonnull=no], [AS_CASE([$host_os], [# Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | gnu* | *-musl* | midipix* | midnightbsd* \ | hpux* | solaris* | cygwin* | mingw* | windows* | msys*], - [ac_cv_func_malloc_0_nonnull="guessing yes"], - [# Guess as follows if we don't know. - ac_cv_func_malloc_0_nonnull=$gl_cross_guess_normal])])]) - AS_CASE([$ac_cv_func_calloc_0_nonnull], [*yes], [$1], [$2]) + [gl_cv_func_calloc_0_nonnull="guessing yes"], + [# If we don't know, obey --enable-cross-guesses. + gl_cv_func_calloc_0_nonnull="$gl_cross_guess_normal"])])]) + AS_CASE([$gl_cv_func_calloc_0_nonnull], [*yes], [$1], [$2]) ])