bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] passfd: allow compilation on mingw


From: Bruno Haible
Subject: Re: [PATCH 2/3] passfd: allow compilation on mingw
Date: Sat, 30 Apr 2011 13:38:34 +0200
User-agent: KMail/1.9.9

Eric Blake wrote:
> --- a/tests/test-sys_socket.c
> +++ b/tests/test-sys_socket.c
> @@ -30,6 +30,12 @@ int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
>  /* Check that the 'socklen_t' type is defined.  */
>  socklen_t t1;
> 
> +/* Check that 'struct iovec' is defined.  */
> +struct iovec io;
> 

This new test fails on OpenBSD 4.4:

gcc -DHAVE_CONFIG_H -I.  -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. -I./..  
-I../gllib -I./../gllib    -g -O2 -MT test-sys_socket.o -MD -MP -MF 
.deps/test-sys_socket.Tpo -c -o test-sys_socket.o test-sys_socket.c
test-sys_socket.c: In function `main':
test-sys_socket.c:62: error: dereferencing pointer to incomplete type
test-sys_socket.c: At top level:
test-sys_socket.c:34: error: storage size of `io' isn't known
*** Error code 1

This should fix it.


2011-04-30  Bruno Haible  <address@hidden>

        sys_socket: Ensure 'struct iovec' definition.
        * lib/sys_socket.in.h: Include <sys/uio.h> also on platforms that have
        <sys/socket.h>.
        * doc/posix-headers/sys_socket.texi: Mention the OpenBSD problem.

--- doc/posix-headers/sys_socket.texi.orig      Sat Apr 30 13:37:49 2011
+++ doc/posix-headers/sys_socket.texi   Sat Apr 30 13:30:54 2011
@@ -17,6 +17,9 @@
 This header file does not define the type @code{socklen_t} on some platforms:
 HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
 @item
+This header file does not define the type @code{struct iovec} on some 
platforms:
+OpenBSD 4.4.
address@hidden
 This header file is lacking the @code{SHUT_RD}, @code{SHUT_WR},
 @code{SHUT_RDWR} macros on some platforms, despite having the @code{shutdown}
 functions:
--- lib/sys_socket.in.h.orig    Sat Apr 30 13:37:49 2011
+++ lib/sys_socket.in.h Sat Apr 30 13:37:42 2011
@@ -108,6 +108,12 @@
 
 #endif
 
+/* Get struct iovec.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if ! defined __GLIBC__
+# include <sys/uio.h>
+#endif
+
 #if @HAVE_SYS_SOCKET_H@
 
 /* A platform that has <sys/socket.h>.  */
@@ -176,9 +182,6 @@
 
 # endif
 
-/* For struct iovec */
-# include <sys/uio.h>
-
 /* Rudimentary 'struct msghdr'; this works as long as you don't try to
    access msg_control or msg_controllen.  */
 struct msghdr {
-- 
In memoriam Casey Jones <http://en.wikipedia.org/wiki/Casey_Jones>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]