summaryrefslogtreecommitdiffstats
path: root/gl/m4/malloc.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/malloc.m4')
-rw-r--r--gl/m4/malloc.m414
1 files changed, 8 insertions, 6 deletions
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 5540292..41a4693 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,5 +1,6 @@
1# malloc.m4 serial 28 1# malloc.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 31
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -16,7 +17,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
16 [[#include <stdlib.h> 17 [[#include <stdlib.h>
17 ]], 18 ]],
18 [[void *p = malloc (0); 19 [[void *p = malloc (0);
19 int result = !p; 20 void * volatile vp = p;
21 int result = !vp;
20 free (p); 22 free (p);
21 return result;]]) 23 return result;]])
22 ], 24 ],
@@ -25,8 +27,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
25 [case "$host_os" in 27 [case "$host_os" in
26 # Guess yes on platforms where we know the result. 28 # Guess yes on platforms where we know the result.
27 *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ 29 *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
28 | gnu* | *-musl* | midnightbsd* \ 30 | gnu* | *-musl* | midipix* | midnightbsd* \
29 | hpux* | solaris* | cygwin* | mingw* | msys* ) 31 | hpux* | solaris* | cygwin* | mingw* | windows* | msys* )
30 ac_cv_func_malloc_0_nonnull="guessing yes" ;; 32 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
31 # If we don't know, obey --enable-cross-guesses. 33 # If we don't know, obey --enable-cross-guesses.
32 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; 34 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
@@ -128,7 +130,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
128 dnl except on those platforms where we have seen 'test-malloc-gnu', 130 dnl except on those platforms where we have seen 'test-malloc-gnu',
129 dnl 'test-realloc-gnu', 'test-calloc-gnu' fail. 131 dnl 'test-realloc-gnu', 'test-calloc-gnu' fail.
130 case "$host_os" in 132 case "$host_os" in
131 mingw*) 133 mingw* | windows*)
132 gl_cv_func_malloc_posix=no ;; 134 gl_cv_func_malloc_posix=no ;;
133 irix* | solaris*) 135 irix* | solaris*)
134 dnl On IRIX 6.5, the three functions return NULL with errno unset 136 dnl On IRIX 6.5, the three functions return NULL with errno unset