# HG changeset patch # User Bruno Haible # Date 1174615722 0 # Node ID 7304ea5306408566175df17c368fc50b2ddbe9b1 # Parent accc767de343620334f668bfd0a9fa15b0f3f10c Fix a compilation error on BeOS. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-22 Bruno Haible + + * 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 * modules/frexpl-tests: New file. diff --git a/modules/sys_socket-tests b/modules/sys_socket-tests --- a/modules/sys_socket-tests +++ b/modules/sys_socket-tests @@ -4,6 +4,7 @@ Depends-on: configure.ac: +AC_CHECK_FUNCS([shutdown]) Makefile.am: TESTS += test-sys_socket diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c --- a/tests/test-sys_socket.c +++ b/tests/test-sys_socket.c @@ -23,14 +23,16 @@ #include +#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: