]> Savannah Git Hosting - gnulib.git/commitdiff
Improve log output of an Autoconf test.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Nov 2024 11:25:22 +0000 (12:25 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 1 Nov 2024 11:27:13 +0000 (12:27 +0100)
* m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): On native Windows, report
"guessing yes/no".
(gl_FUNC_MALLOC_POSIX): Update.
* m4/strdup.m4 (gl_FUNC_STRDUP_POSIX): Likewise.

ChangeLog
m4/malloc.m4
m4/strdup.m4

index fcf057ebfefe77a94b9c459fcddd5d140c7c6f1a..36e34b048d6d5e7cd1def071c3cb77a55f12d0c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-01  Bruno Haible  <bruno@clisp.org>
+
+       Improve log output of an Autoconf test.
+       * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): On native Windows, report
+       "guessing yes/no".
+       (gl_FUNC_MALLOC_POSIX): Update.
+       * m4/strdup.m4 (gl_FUNC_STRDUP_POSIX): Likewise.
+
 2024-10-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        malloc, realloc: fix $3 bug
index 0d4014de4416205ccdabb515ecc4a368a2d28b92..657eed779ca9b827c2af1266d65a12f933d2deaa 100644 (file)
@@ -1,5 +1,5 @@
 # malloc.m4
-# serial 39
+# serial 40
 dnl Copyright (C) 2007, 2009-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,
@@ -119,16 +119,19 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX],
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_MALLOC_PTRDIFF])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
-  if test "$gl_cv_func_malloc_posix" = yes; then
-    AC_DEFINE([HAVE_MALLOC_POSIX], [1],
-      [Define if malloc, realloc, and calloc set errno on allocation failure.])
-  else
-    REPLACE_MALLOC_FOR_MALLOC_POSIX=1
-  fi
+  case "$gl_cv_func_malloc_posix" in
+    *yes)
+      AC_DEFINE([HAVE_MALLOC_POSIX], [1],
+        [Define if malloc, realloc, and calloc set errno on allocation failure.])
+      ;;
+    *)
+      REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+      ;;
+  esac
 ])
 
 # Test whether malloc, realloc, calloc set errno to ENOMEM on failure.
-# Set gl_cv_func_malloc_posix to yes or no accordingly.
+# Set gl_cv_func_malloc_posix to *yes or *no accordingly.
 AC_DEFUN([gl_CHECK_MALLOC_POSIX],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
@@ -154,8 +157,8 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
               ]],
               [[]])
             ],
-            [gl_cv_func_malloc_posix=yes],
-            [gl_cv_func_malloc_posix=no])
+            [gl_cv_func_malloc_posix="guessing yes"],
+            [gl_cv_func_malloc_posix="guessing no"])
           ;;
         irix* | solaris*)
           dnl On IRIX 6.5, the three functions return NULL with errno unset
index 33452dca47f28494dffddb1eba7111307dc1123b..d6989b52d43ddd34f488a1aeda6c8322a74231ef 100644 (file)
@@ -1,5 +1,5 @@
 # strdup.m4
-# serial 15
+# serial 16
 
 dnl Copyright (C) 2002-2024 Free Software Foundation, Inc.
 
@@ -21,9 +21,10 @@ AC_DEFUN([gl_FUNC_STRDUP_POSIX],
 [
   AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
-  if test $gl_cv_func_malloc_posix != yes; then
-    REPLACE_STRDUP=1
-  fi
+  case "$gl_cv_func_malloc_posix" in
+    *yes) ;;
+    *)    REPLACE_STRDUP=1 ;;
+  esac
   AC_CHECK_DECLS_ONCE([strdup])
   if test $ac_cv_have_decl_strdup = no; then
     HAVE_DECL_STRDUP=0