From 5ca443e0b95097f86c466efe051221851c1bc84f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 12:27:03 +0100 Subject: [PATCH 23/47] Resolve conflicts for functions introduced in Android API level 21. * m4/stpncpy.m4 (gl_FUNC_STPNCPY): Conditionally set REPLACE_STPNCPY. * lib/string.in.h (stpncpy): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 4 ++++ lib/string.in.h | 2 ++ m4/stpncpy.m4 | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3de67682f1..092a3b50d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Resolve conflicts for functions introduced in Android API level 21. + * m4/stpncpy.m4 (gl_FUNC_STPNCPY): Conditionally set REPLACE_STPNCPY. + * lib/string.in.h (stpncpy): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + * m4/random.m4 (gl_FUNC_RANDOM): Conditionally set REPLACE_INITSTATE, REPLACE_SETSTATE. * lib/stdlib.in.h (initstate, setstate): Disable _GL_CXXALIASWARN diff --git a/lib/string.in.h b/lib/string.in.h index ffcc7e25c6..7d0104ce55 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -462,7 +462,9 @@ _GL_CXXALIAS_SYS (stpncpy, char *, (char *restrict __dst, char const *restrict __src, size_t __n)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (stpncpy); +# endif #elif defined GNULIB_POSIXCHECK # undef stpncpy # if HAVE_RAW_DECL_STPNCPY diff --git a/m4/stpncpy.m4 b/m4/stpncpy.m4 index c321093b66..b9850364ed 100644 --- a/m4/stpncpy.m4 +++ b/m4/stpncpy.m4 @@ -1,4 +1,4 @@ -# stpncpy.m4 serial 20 +# stpncpy.m4 serial 21 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -96,6 +96,9 @@ int main () esac else HAVE_STPNCPY=0 + case "$gl_cv_onwards_func_stpncpy" in + future*) REPLACE_STPNCPY=1 ;; + esac fi ]) -- 2.34.1