]> Savannah Git Hosting - gnulib.git/commitdiff
calloc: Fix configure test (regression yesterday).
authorBruno Haible <bruno@clisp.org>
Tue, 5 Nov 2024 14:30:49 +0000 (15:30 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 5 Nov 2024 14:30:49 +0000 (15:30 +0100)
* m4/calloc.m4 (gl_FUNC_CALLOC_IF): Fix wrong cache variable name.
Rename cache variable. Restore earlier comment.

ChangeLog
m4/calloc.m4

index 89cc5a95a73c2639fb205d94bcdbb8819566f6bc..0d9114ca3c8b06dc0b809d6756b02c8bacb624b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-11-05  Bruno Haible  <bruno@clisp.org>
+
+       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  <eggert@cs.ucla.edu>
 
        safe-alloc: simplify, given new reallocarray behavior
index 6514bd1cf93118591002866db6190e89dbe189a5..a4a006e3d93dcfe3c6cdedb54e79734c982fc9fc 100644 (file)
@@ -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 <stdlib.h>
@@ -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])
 ])