From 1b410d477f4021e86f5594b84f5bd8170e676485 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 14:49:05 +0100 Subject: [PATCH 47/47] Resolve conflicts for functions introduced in Android API level 29. * m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Conditionally set REPLACE_REALLOCARRAY. * lib/stdlib.in.h (reallocarray): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 5 +++++ lib/stdlib.in.h | 2 ++ m4/reallocarray.m4 | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9836300631..33473610a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Resolve conflicts for functions introduced in Android API level 29. + * m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Conditionally set + REPLACE_REALLOCARRAY. + * lib/stdlib.in.h (reallocarray): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + * lib/stdlib.in.h (getloadavg): Consider REPLACE_GETLOADAVG. Disable _GL_CXXALIASWARN invocation on non-glibc systems. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_GETLOADAVG. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index ba1d8bff4e..a91f4e23d6 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1280,7 +1280,9 @@ _GL_FUNCDECL_SYS (reallocarray, void *, _GL_CXXALIAS_SYS (reallocarray, void *, (void *ptr, size_t nmemb, size_t size)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (reallocarray); +# endif #elif defined GNULIB_POSIXCHECK # undef reallocarray # if HAVE_RAW_DECL_REALLOCARRAY diff --git a/m4/reallocarray.m4 b/m4/reallocarray.m4 index 4be7cd1be2..6a5b5ab344 100644 --- a/m4/reallocarray.m4 +++ b/m4/reallocarray.m4 @@ -1,4 +1,4 @@ -# reallocarray.m4 serial 4 +# reallocarray.m4 serial 5 dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,9 @@ AC_DEFUN([gl_FUNC_REALLOCARRAY], gl_CHECK_FUNCS_ANDROID([reallocarray], [[#include ]]) if test "$ac_cv_func_reallocarray" = no; then HAVE_REALLOCARRAY=0 + case "$gl_cv_onwards_func_reallocarray" in + future*) REPLACE_REALLOCARRAY=1 ;; + esac elif test "$gl_cv_malloc_ptrdiff" = no; then REPLACE_REALLOCARRAY=1 fi -- 2.34.1