From: Bruno Haible Date: Sun, 9 May 2021 22:59:21 +0000 (+0200) Subject: {realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18). X-Git-Tag: v1.0~2900 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c499a3c497de473fd6a2ee78a76402b8846cac8a;p=thirdparty%2Fgnulib.git {realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18). * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Don't reset REPLACE_REALLOC to 0 if it is already 1 after gl_FUNC_REALLOC_GNU was executed. * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Don't reset REPLACE_CALLOC to 0 if it is already 1 after gl_FUNC_CALLOC_GNU was executed. --- diff --git a/ChangeLog b/ChangeLog index 7e7f25813c..314ba87c62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-05-09 Bruno Haible + {realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18). + * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Don't reset REPLACE_REALLOC + to 0 if it is already 1 after gl_FUNC_REALLOC_GNU was executed. + * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Don't reset REPLACE_CALLOC + to 0 if it is already 1 after gl_FUNC_CALLOC_GNU was executed. + {malloc,realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18). * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Don't assume that _AC_FUNC_MALLOC_IF expands to a single shell statement. diff --git a/m4/calloc.m4 b/m4/calloc.m4 index 7575a69a7e..fe12b15d09 100644 --- a/m4/calloc.m4 +++ b/m4/calloc.m4 @@ -1,4 +1,4 @@ -# calloc.m4 serial 26 +# calloc.m4 serial 27 # Copyright (C) 2004-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -72,7 +72,9 @@ AC_DEFUN([gl_FUNC_CALLOC_POSIX], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) - REPLACE_CALLOC=$REPLACE_MALLOC + if test $REPLACE_MALLOC = 1; then + REPLACE_CALLOC=1 + fi dnl Although in theory we should also test for size_t overflow, dnl in practice testing for ptrdiff_t overflow suffices dnl since PTRDIFF_MAX <= SIZE_MAX on all known Gnulib porting targets. diff --git a/m4/realloc.m4 b/m4/realloc.m4 index 9925917848..0abc4185ed 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,4 +1,4 @@ -# realloc.m4 serial 23 +# realloc.m4 serial 24 dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -57,5 +57,7 @@ AC_DEFUN([gl_FUNC_REALLOC_POSIX], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) - REPLACE_REALLOC=$REPLACE_MALLOC + if test $REPLACE_MALLOC = 1; then + REPLACE_REALLOC=1 + fi ])