]> Savannah Git Hosting - gnulib.git/commitdiff
Resolve conflicts for functions introduced in Android API level 21.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 10:47:22 +0000 (11:47 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 14:56:24 +0000 (15:56 +0100)
* lib/search.in.h (twalk): Consider REPLACE_TWALK.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize REPLACE_TWALK.
* modules/search (Makefile.am): Substitute REPLACE_TWALK.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Conditionally set REPLACE_TWALK.
* modules/tsearch (configure.ac): Consider REPLACE_TWALK.

ChangeLog
lib/search.in.h
m4/search_h.m4
m4/tsearch.m4
modules/search
modules/tsearch

index 449746ce959af667201116aee4df44cbc8676e6e..b6deccf06537340e9d73f513e864a62d5f2415e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-01-22  Bruno Haible  <bruno@clisp.org>
+
+       Resolve conflicts for functions introduced in Android API level 21.
+
+       * lib/search.in.h (twalk): Consider REPLACE_TWALK.
+       * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize REPLACE_TWALK.
+       * modules/search (Makefile.am): Substitute REPLACE_TWALK.
+       * m4/tsearch.m4 (gl_FUNC_TSEARCH): Conditionally set REPLACE_TWALK.
+       * modules/tsearch (configure.ac): Consider REPLACE_TWALK.
+
 2023-01-22  Bruno Haible  <bruno@clisp.org>
 
        Resolve conflicts for functions introduced in Android API level 19.
index e8cd6992e76dc8eac714a9ae24d931199847137f..32b022edc65e90d0192a945973d3976612617ab1 100644 (file)
@@ -100,6 +100,10 @@ _GL_CXXALIASWARN (lsearch);
 #   define tsearch rpl_tsearch
 #   define tfind rpl_tfind
 #   define tdelete rpl_tdelete
+#  endif
+# endif
+# if @REPLACE_TWALK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define twalk rpl_twalk
 #  endif
 # endif
@@ -224,7 +228,7 @@ _GL_CXXALIASWARN (tdelete);
         pointer to the key,
      2. an indicator which visit of the node this is,
      3. the level of the node in the tree (0 for the root).  */
-# if @REPLACE_TSEARCH@
+# if @REPLACE_TWALK@
 _GL_FUNCDECL_RPL (twalk, void,
                   (const void *vroot, _gl_search_action_fn action)
                   _GL_ARG_NONNULL ((2)));
@@ -245,7 +249,7 @@ _GL_CXXALIASWARN (twalk);
 
 /* Flags used by tsearch.c.  */
 # define GNULIB_defined_tsearch  (@REPLACE_TSEARCH@ || !@HAVE_TSEARCH@)
-# define GNULIB_defined_twalk    (@REPLACE_TSEARCH@ || !@HAVE_TWALK@)
+# define GNULIB_defined_twalk    (@REPLACE_TWALK@ || !@HAVE_TWALK@)
 
 #elif defined GNULIB_POSIXCHECK
 # undef tsearch
index 4fb2c77b09415bd9ac4b45981e354c1bbd25470e..a8c87abceeba255e5d883f529425d1ca44874de8 100644 (file)
@@ -1,4 +1,4 @@
-# search_h.m4 serial 15
+# search_h.m4 serial 16
 dnl Copyright (C) 2007-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,
@@ -78,4 +78,5 @@ AC_DEFUN([gl_SEARCH_H_DEFAULTS],
   HAVE_TSEARCH=1;    AC_SUBST([HAVE_TSEARCH])
   HAVE_TWALK=1;      AC_SUBST([HAVE_TWALK])
   REPLACE_TSEARCH=0; AC_SUBST([REPLACE_TSEARCH])
+  REPLACE_TWALK=0;   AC_SUBST([REPLACE_TWALK])
 ])
index 0781151e525ad0576d46dbbe055c7accf436a21b..c2ddc8a71e9b7a162768c5ac1b7c41a4244839ae 100644 (file)
@@ -1,4 +1,4 @@
-# tsearch.m4 serial 11
+# tsearch.m4 serial 12
 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,
@@ -49,6 +49,7 @@ main ()
     case "$gl_cv_func_tdelete_works" in
       *no)
         REPLACE_TSEARCH=1
+        REPLACE_TWALK=1
         ;;
     esac
   else
@@ -59,6 +60,9 @@ main ()
   fi
   if test $ac_cv_func_twalk != yes; then
     HAVE_TWALK=0
+    case "$gl_cv_onwards_func_twalk" in
+      future*) REPLACE_TWALK=1 ;;
+    esac
   fi
 ])
 
index ad9382fc1ba66ef62017880f5a889c51f856aeeb..2debf36b89edd6c0a8955c40ed6f31fa3a8007e8 100644 (file)
@@ -38,6 +38,7 @@ search.h: search.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_TSEARCH''@|$(HAVE_TSEARCH)|g' \
              -e 's|@''HAVE_TWALK''@|$(HAVE_TWALK)|g' \
              -e 's|@''REPLACE_TSEARCH''@|$(REPLACE_TSEARCH)|g' \
+             -e 's|@''REPLACE_TWALK''@|$(REPLACE_TWALK)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
index 91ef56c8c0e9099d22a738b8d415ea94e7946e1d..c4c363b7a6bf4874412fc29a4c84e46ea414faef 100644 (file)
@@ -11,7 +11,7 @@ search
 configure.ac:
 gl_FUNC_TSEARCH
 gl_CONDITIONAL([GL_COND_OBJ_TSEARCH],
-               [test $HAVE_TSEARCH = 0 || test $HAVE_TWALK = 0 || test $REPLACE_TSEARCH = 1])
+               [test $HAVE_TSEARCH = 0 || test $HAVE_TWALK = 0 || test $REPLACE_TSEARCH = 1 || test $REPLACE_TWALK = 1])
 AM_COND_IF([GL_COND_OBJ_TSEARCH], [
   gl_PREREQ_TSEARCH
 ])