From 0c95a29b1912c4413748b301df314b9358289160 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 20 Apr 2008 13:15:16 +0200 Subject: [PATCH] Fix link error on mingw. --- ChangeLog | 5 +++++ modules/tsearch-tests | 1 + tests/test-tsearch.c | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a562163b7..a8f5487d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-20 Bruno Haible + * tests/test-tsearch.c (main): Don't use initstate if it is missing. + * modules/tsearch-tests (configure.ac): Test for initstate function. + +2008-04-20 Bruno Haible + * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Also provided a substitute for nlink_t if missing. * tests/test-sys_stat.c: Check the existence of the nlink_t type. diff --git a/modules/tsearch-tests b/modules/tsearch-tests index abf03192b..4f1f72f91 100644 --- a/modules/tsearch-tests +++ b/modules/tsearch-tests @@ -15,6 +15,7 @@ AC_TRY_LINK([ double x;], [x = log (x);], , [TEST_TSEARCH_LIBM=-lm]) AC_SUBST([TEST_TSEARCH_LIBM]) +AC_CHECK_FUNCS([initstate]) Makefile.am: TESTS += test-tsearch.sh diff --git a/tests/test-tsearch.c b/tests/test-tsearch.c index b6a22fa9f..eb465e834 100644 --- a/tests/test-tsearch.c +++ b/tests/test-tsearch.c @@ -1,5 +1,5 @@ /* Test program for tsearch et al. - Copyright (C) 1997, 2000, 2001, 2007 Free Software Foundation, Inc. + Copyright (C) 1997, 2000-2001, 2007-2008 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software: you can redistribute it and/or @@ -256,7 +256,9 @@ main (int argc, char **argv) void *root = NULL; int i, j; +#if HAVE_INITSTATE initstate (SEED, state, 8); +#endif for (i = 0; i < SIZE; ++i) x[i] = i; -- 2.11.0