Fix a compilation error on BeOS.
authorBruno Haible <bruno@clisp.org>
Fri, 23 Mar 2007 02:08:42 +0000 (02:08 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 23 Mar 2007 02:08:42 +0000 (02:08 +0000)
ChangeLog
modules/sys_socket-tests
tests/test-sys_socket.c

index 25fe126..92ebab0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-03-22  Bruno Haible  <bruno@clisp.org>
 
+       * modules/sys_socket-tests (configure.ac): Check for shutdown function.
+       * tests/test-sys_socket.c (a): Test only if shutdown() exists.
+       (main): Update.
+       Fixes a compilation error on BeOS.
+
+2007-03-22  Bruno Haible  <bruno@clisp.org>
+
        * modules/frexpl-tests: New file.
        * tests/test-frexpl.c: New file.
 
index 9a23162..bce231e 100644 (file)
@@ -4,6 +4,7 @@ tests/test-sys_socket.c
 Depends-on:
 
 configure.ac:
+AC_CHECK_FUNCS([shutdown])
 
 Makefile.am:
 TESTS += test-sys_socket
index 69ae4c7..385cc5d 100644 (file)
 
 #include <errno.h>
 
+#if HAVE_SHUTDOWN
 /* Check some integer constant expressions.  */
 int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+#endif
 
 int
 main ()
 {
   /* Check some errno values.  */
-  switch (a[0])
+  switch (0)
     {
     case ENOTSOCK:
     case EADDRINUSE: