Update Gnulib to the latest git version
[deliverable/binutils-gdb.git] / gnulib / import / m4 / malloc.m4
index c393690e27d95917afb601352af3d3b0dfbb86ce..6555dee650016ddd28bc143eaf24f1b1a221029c 100644 (file)
@@ -1,13 +1,11 @@
-# malloc.m4 serial 15
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# malloc.m4 serial 20
+dnl Copyright (C) 2007, 2009-2019 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:
-# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
 AC_DEFUN([_AC_FUNC_MALLOC_IF],
 [
   AC_REQUIRE([AC_HEADER_STDC])dnl
@@ -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* | 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
@@ -91,7 +94,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
       AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
            [[]],
-           [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+           [[#if defined _WIN32 && ! defined __CYGWIN__
              choke me
              #endif
             ]])],
This page took 0.025491 seconds and 4 git commands to generate.