From 641f40488e71b69b18f999ed913040382dfc825c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 23 Mar 2007 02:08:42 +0000 Subject: [PATCH] Fix a compilation error on BeOS. --- ChangeLog | 7 +++++++ modules/sys_socket-tests | 1 + tests/test-sys_socket.c | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 25fe12602..92ebab081 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 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. * tests/test-frexpl.c: New file. diff --git a/modules/sys_socket-tests b/modules/sys_socket-tests index 9a2316280..bce231e35 100644 --- a/modules/sys_socket-tests +++ b/modules/sys_socket-tests @@ -4,6 +4,7 @@ tests/test-sys_socket.c 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 index 69ae4c71f..385cc5d2c 100644 --- 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: -- 2.11.0