strengthen self-containedness check for sys/select.h
authorPaolo Bonzini <bonzini@gnu.org>
Mon, 29 Sep 2008 10:02:35 +0000 (12:02 +0200)
committerPaolo Bonzini <bonzini@gnu.org>
Mon, 29 Sep 2008 11:28:57 +0000 (13:28 +0200)
2008-09-29  Paolo Bonzini  <bonzini@gnu.org>
            Bruno Haible  <bruno@clisp.org>

* lib/sys_select.in.h: Include sys/time.h.
* m4/sys_select.h.m4: Test that struct timeval is fully defined.
* modules/sys_select: Depend on sys_time.
* tests/test-sys_select.c: Test that sys/select.h defines struct
timeval fully.

ChangeLog
lib/sys_select.in.h
m4/sys_select_h.m4
modules/sys_select
tests/test-sys_select.c

index bdff5cc5e6e7aab1cb3d603996fe2ccd7ea02f79..42f640117ef7243ed21dd5f4aab3555b6dae3fd9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-29  Paolo Bonzini  <bonzini@gnu.org>
+            Bruno Haible  <bruno@clisp.org>
+
+       * lib/sys_select.in.h: Include sys/time.h.
+       * m4/sys_select.h.m4: Test that struct timeval is fully defined.
+       * modules/sys_select: Depend on sys_time.
+       * tests/test-sys_select.c: Test that sys/select.h defines struct
+       timeval fully.
+
 2008-09-29  Bruno Haible  <bruno@clisp.org>
 
        * lib/sys_socket.in.h: Wrap the definitions in 'extern "C"'.
index 255c02ffd83b1decfd65f828bf504b889fe8333e..396f2094781f394f5a0e2e6e9dc8297e61094ed6 100644 (file)
    <sys/types.h>.  */
 # include <sys/types.h>
 
+/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
+   of 'struct timeval', and no definition of this type..  */
+# include <sys/time.h>
+
 /* The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
 
index f9468af1dd63b1c3b922eb4f240dd2bf2c01c2f0..865a414426eb59eece761c096eb58e12f5cda0e3 100644 (file)
@@ -10,7 +10,8 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
   AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
     [gl_cv_header_sys_select_h_selfcontained],
     [
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]], [[]])],
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]],
+                                        [[struct timeval b;]])],
         [gl_cv_header_sys_select_h_selfcontained=yes],
         [gl_cv_header_sys_select_h_selfcontained=no])
     ])
index f2f769890c80bbb8615d17900d728fb6bd47e843..4f13917818d3e32bd0b4e4852213fa28ffa29f82 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 alloca
 include_next
 sys_socket
+sys_time
 
 configure.ac:
 gl_HEADER_SYS_SELECT
index 6bdd650831b85f0c905fe2607bf73ca274d62ea5..053b6c68d713f764ac0f5a02192a7252d6cba404 100644 (file)
 
 #include <config.h>
 
+#include <sys/select.h>
+
+/* Check that the 'struct timeval' type is defined.  */
+struct timeval t1;
+
 #include <stdio.h>
 #include <string.h>
-#include <sys/select.h>
-#include <sys/time.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <fcntl.h>