>From 74706dd7b80249312e832f768ca4e9699986e4cf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 02:05:15 +0100 Subject: [PATCH 10/47] Resolve conflicts for functions introduced in Android API level 16. * m4/tsearch.m4 (gl_FUNC_TSEARCH): Conditionally set REPLACE_TSEARCH. * lib/search.in.h (tsearch, tfind, tdelete, twalk): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 4 ++++ lib/search.in.h | 8 ++++++++ m4/tsearch.m4 | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7283803817..8f536cfc73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Resolve conflicts for functions introduced in Android API level 16. + * m4/tsearch.m4 (gl_FUNC_TSEARCH): Conditionally set REPLACE_TSEARCH. + * lib/search.in.h (tsearch, tfind, tdelete, twalk): Disable + _GL_CXXALIASWARN invocation on non-glibc systems. + * m4/faccessat.m4 (gl_FUNC_FACCESSAT): Conditionally set REPLACE_FACCESSAT. * lib/unistd.in.h (faccessat): Disable _GL_CXXALIASWARN invocation on diff --git a/lib/search.in.h b/lib/search.in.h index cf5bfb9b1b..e8cd6992e7 100644 --- a/lib/search.in.h +++ b/lib/search.in.h @@ -156,7 +156,9 @@ _GL_CXXALIAS_SYS (tsearch, void *, (const void *key, void **vrootp, _gl_search_compar_fn compar)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (tsearch); +# endif /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is returned. Otherwise, NULL is returned. */ @@ -181,7 +183,9 @@ _GL_CXXALIAS_SYS_CAST (tfind, void *, (const void *key, void *const *vrootp, _gl_search_compar_fn compar)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (tfind); +# endif /* Searches an element in the tree *VROOTP that compares equal to KEY. If one is found, it is removed from the tree, and its parent node is @@ -205,7 +209,9 @@ _GL_CXXALIAS_SYS (tdelete, void *, (const void *restrict key, void **restrict vrootp, _gl_search_compar_fn compar)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (tdelete); +# endif /* Perform a depth-first, left-to-right traversal of the tree VROOT. The ACTION function is called: @@ -233,7 +239,9 @@ _GL_FUNCDECL_SYS (twalk, void, _GL_CXXALIAS_SYS (twalk, void, (const void *vroot, _gl_search_action_fn action)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (twalk); +# endif /* Flags used by tsearch.c. */ # define GNULIB_defined_tsearch (@REPLACE_TSEARCH@ || !@HAVE_TSEARCH@) diff --git a/m4/tsearch.m4 b/m4/tsearch.m4 index d78da9b198..0781151e52 100644 --- a/m4/tsearch.m4 +++ b/m4/tsearch.m4 @@ -1,4 +1,4 @@ -# tsearch.m4 serial 10 +# tsearch.m4 serial 11 dnl Copyright (C) 2006-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, @@ -53,6 +53,9 @@ main () esac else HAVE_TSEARCH=0 + case "$gl_cv_onwards_func_tsearch" in + future*) REPLACE_TSEARCH=1 ;; + esac fi if test $ac_cv_func_twalk != yes; then HAVE_TWALK=0 -- 2.34.1