Fix link error on mingw.
authorBruno Haible <bruno@clisp.org>
Sun, 20 Apr 2008 11:15:16 +0000 (13:15 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 20 Apr 2008 11:15:16 +0000 (13:15 +0200)
ChangeLog
modules/tsearch-tests
tests/test-tsearch.c

index a562163b7c96b1a14ad208c6df592522a493c844..a8f5487d0707053bfc5d6ad9551bee641186abe1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-20  Bruno Haible  <bruno@clisp.org>
+
+       * 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  <bruno@clisp.org>
 
        * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Also provided a substitute
index abf03192bb9faac6345c07eefadb74a8b9c22101..4f1f72f917b329dd29d331eee2f0d63bc417d534 100644 (file)
@@ -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
index b6a22fa9f08d4608f5729b70af114b3eabe627b4..eb465e8347e6982fdb944fe4f7ed857d6b79a8a6 100644 (file)
@@ -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;