1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-10 04:43:00 +03:00

malloca: port better to AIX extensions

Also, switch from eealloc.m4 to malloc.m4 to determine
whether malloc (0) returns nonnull.
* lib/malloca.c (mmalloca): Use HAVE_MALLOC_0_NONNULL,
not MALLOC_0_IS_NONNULL.
* m4/malloca.m4 (gl_MALLOCA): Require gl_FUNC_MALLOC_GNU,
not gl_EEMALLOC.
* modules/malloca (Files): Remove m4/eemalloc.m4.
(Depends-on): Add extensions-aix.
* modules/relocatable-prog-wrapper:
AC_REQUIRE gl_FUNC_MALLOC_POSIX to suppress Autoconf 2.71
“warning: AC_REQUIRE: `gl_FUNC_MALLOC_POSIX' was expanded before
it was required”.
This commit is contained in:
Paul Eggert
2024-11-05 22:06:54 -08:00
parent 01c2e2e64f
commit ad9996409a
5 changed files with 19 additions and 5 deletions

View File

@@ -1,5 +1,19 @@
2024-11-05 Paul Eggert <eggert@cs.ucla.edu> 2024-11-05 Paul Eggert <eggert@cs.ucla.edu>
malloca: port better to AIX extensions
Also, switch from eealloc.m4 to malloc.m4 to determine
whether malloc (0) returns nonnull.
* lib/malloca.c (mmalloca): Use HAVE_MALLOC_0_NONNULL,
not MALLOC_0_IS_NONNULL.
* m4/malloca.m4 (gl_MALLOCA): Require gl_FUNC_MALLOC_GNU,
not gl_EEMALLOC.
* modules/malloca (Files): Remove m4/eemalloc.m4.
(Depends-on): Add extensions-aix.
* modules/relocatable-prog-wrapper:
AC_REQUIRE gl_FUNC_MALLOC_POSIX to suppress Autoconf 2.71
“warning: AC_REQUIRE: `gl_FUNC_MALLOC_POSIX' was expanded before
it was required”.
malloc: refactor to help replace eealloc malloc: refactor to help replace eealloc
* m4/malloc.m4 (gl_FUNC_MALLOC_0_NONNULL): * m4/malloc.m4 (gl_FUNC_MALLOC_0_NONNULL):
New macro, split out from gl_FUNC_MALLOC_GNU. New macro, split out from gl_FUNC_MALLOC_GNU.

View File

@@ -93,7 +93,7 @@ mmalloca (size_t n)
/* Out of memory. */ /* Out of memory. */
return NULL; return NULL;
#else #else
# if !MALLOC_0_IS_NONNULL # if !HAVE_MALLOC_0_NONNULL
if (n == 0) if (n == 0)
n = 1; n = 1;
# endif # endif

View File

@@ -1,5 +1,5 @@
# malloca.m4 # malloca.m4
# serial 2 # serial 3
dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation, dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation,
dnl Inc. dnl Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
@@ -12,5 +12,5 @@ AC_DEFUN([gl_MALLOCA],
dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
dnl @ALLOCA@ and @LTALLOCA@. dnl @ALLOCA@ and @LTALLOCA@.
dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([gl_FUNC_MALLOC_GNU])
]) ])

View File

@@ -5,12 +5,12 @@ Files:
lib/malloca.h lib/malloca.h
lib/malloca.c lib/malloca.c
m4/malloca.m4 m4/malloca.m4
m4/eealloc.m4
m4/malloc.m4 m4/malloc.m4
Depends-on: Depends-on:
alloca-opt alloca-opt
assert-h assert-h
extensions-aix
idx idx
stdckdint stdckdint
stdint stdint

View File

@@ -85,7 +85,7 @@ configure.ac:
AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_C_RESTRICT])
gl_FUNC_READLINK_SEPARATE gl_FUNC_READLINK_SEPARATE
gl_CANONICALIZE_LGPL_SEPARATE gl_CANONICALIZE_LGPL_SEPARATE
gl_FUNC_MALLOC_POSIX AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
gl_FUNC_REALLOC_POSIX gl_FUNC_REALLOC_POSIX
gl_FUNC_FREE gl_FUNC_FREE
gl_FUNC_MEMPCPY gl_FUNC_MEMPCPY