summaryrefslogtreecommitdiff
path: root/m4/malloc.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/malloc.m4')
-rw-r--r--m4/malloc.m425
1 files changed, 14 insertions, 11 deletions
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index 4c182b4..c1f8ea3 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,11 +1,9 @@
-# malloc.m4 serial 17
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# malloc.m4 serial 20
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-m4_version_prereq([2.70], [] ,[
-
# This is adapted with modifications from upstream Autoconf here:
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
AC_DEFUN([_AC_FUNC_MALLOC_IF],
@@ -32,19 +30,24 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
[ac_cv_func_malloc_0_nonnull=no],
[case "$host_os" in
# Guess yes on platforms where we know the result.
- *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \
+ *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
- ac_cv_func_malloc_0_nonnull=yes ;;
- # If we don't know, assume the worst.
- *) ac_cv_func_malloc_0_nonnull=no ;;
+ ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
esac
])
])
- AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
+ case "$ac_cv_func_malloc_0_nonnull" in
+ *yes)
+ $1
+ ;;
+ *)
+ $2
+ ;;
+ esac
])# _AC_FUNC_MALLOC_IF
-])
-
# gl_FUNC_MALLOC_GNU
# ------------------
# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if