+2017-02-10 Bruno Haible <bruno@clisp.org>
+
+ search: Don't assume that tsearch() exists if 'VISIT' is defined.
+ * m4/search_h.m4 (gl_SEARCH_H): Determine HAVE_TYPE_VISIT.
+ * modules/search (Makefile.am): Substitute HAVE_TYPE_VISIT.
+ * lib/search.in.h (VISIT): Define if HAVE_TYPE_VISIT is 0.
+
2017-02-09 Bruno Haible <bruno@clisp.org>
doc: Don't mention obsolete AC_LIBTOOL_WIN32_DLL macro.
-# search_h.m4 serial 8
+# search_h.m4 serial 9
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
fi
AC_SUBST([HAVE_SEARCH_H])
+ if test $HAVE_SEARCH_H = 1; then
+ AC_CACHE_CHECK([for type VISIT], [gl_cv_type_VISIT],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_SEARCH_H
+ #include <search.h>
+ #endif
+ ]],
+ [[static VISIT x; x = postorder;]])],
+ [gl_cv_type_VISIT=yes],
+ [gl_cv_type_VISIT=no])])
+ else
+ gl_cv_type_VISIT=no
+ fi
+ if test $gl_cv_type_VISIT = yes; then
+ HAVE_TYPE_VISIT=1
+ else
+ HAVE_TYPE_VISIT=0
+ fi
+ AC_SUBST([HAVE_TYPE_VISIT])
+
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <search.h>
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SEARCH_H''@|$(NEXT_SEARCH_H)|g' \
+ -e 's|@''HAVE_TYPE_VISIT''@|$(HAVE_TYPE_VISIT)|g' \
-e 's/@''GNULIB_TSEARCH''@/$(GNULIB_TSEARCH)/g' \
-e 's|@''HAVE_TSEARCH''@|$(HAVE_TSEARCH)|g' \
-e 's|@''REPLACE_TSEARCH''@|$(REPLACE_TSEARCH)|g' \