summaryrefslogtreecommitdiff
path: root/lib/search.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2018-05-14 00:02:48 +0200
committerBruno Haible <bruno@clisp.org>2018-05-14 00:02:48 +0200
commitb239920976585555781e8ed56ee8ba95ef2060f7 (patch)
tree61ad3dff70452ea029a6cc7a1360041d5d9d3044 /lib/search.in.h
parent88d119b2a44243255dbcd720e296393986d16551 (diff)
downloadgnulib-b239920976585555781e8ed56ee8ba95ef2060f7.tar.gz
tsearch: Fix compilation error on Android.
* lib/search.in.h (twalk): Declare when HAVE_TWALK, not HAVE_TSEARCH, is 0. (GNULIB_defined_tsearch, GNULIB_defined_twalk): New macros. * lib/tsearch.c (tsearch, tfind, tdelete): Define only if GNULIB_defined_tsearch is true. (twalk): Define only if GNULIB_defined_twalk is true. * modules/tsearch (configure.ac): Compile tsearch.c also if HAVE_TWALK is 0. * m4/tsearch.m4 (gl_FUNC_TSEARCH): Set HAVE_TWALK. * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize HAVE_TWALK. * modules/search (Makefile.am): Substitute HAVE_TWALK.
Diffstat (limited to 'lib/search.in.h')
-rw-r--r--lib/search.in.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/search.in.h b/lib/search.in.h
index ce0a0fdb0d..47a4460c80 100644
--- a/lib/search.in.h
+++ b/lib/search.in.h
@@ -169,7 +169,7 @@ _GL_FUNCDECL_RPL (twalk, void,
_GL_CXXALIAS_RPL (twalk, void,
(const void *vroot, _gl_search_action_fn action));
# else
-# if !@HAVE_TSEARCH@
+# if !@HAVE_TWALK@
_GL_FUNCDECL_SYS (twalk, void,
(const void *vroot, _gl_search_action_fn action)
_GL_ARG_NONNULL ((2)));
@@ -179,6 +179,10 @@ _GL_CXXALIAS_SYS (twalk, void,
# endif
_GL_CXXALIASWARN (twalk);
+/* Flags used by tsearch.c. */
+# define GNULIB_defined_tsearch (@REPLACE_TSEARCH@ || !@HAVE_TSEARCH@)
+# define GNULIB_defined_twalk (@REPLACE_TSEARCH@ || !@HAVE_TWALK@)
+
#elif defined GNULIB_POSIXCHECK
# undef tsearch
# if HAVE_RAW_DECL_TSEARCH