bug-gnulib
[Top][All Lists]
Advanced

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

Re: inet_ntop fix for mingw32


From: Simon Josefsson
Subject: Re: inet_ntop fix for mingw32
Date: Tue, 17 Jan 2006 18:22:04 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson wrote:
>> > - sys/socket.h is currently included. It is not needed on OpenBSD 3.4.
>> >   But it is needed for 'socklen_t' to be defined portably, I think - look
>> >   at socklen.m4.
>>
>> Strictly, I don't believe it is needed -- arpa/inet.h must provide a
>> prototype for inet_ntop and consequently also make sure socklen_t is
>> available.
>
> The "consequently" is a false deduction. Look how glibc does it is
> numerous places: They define a private equivalent of the type - would
> be __socklen_t here - and use this private equivalent in the function
> prototypes. So you can have a prototype with a type identical to
> socklen_t but socklen_t is nevertheless not visible.

Ouch.  Ok.

>> Hence, all code that use
>> socklen_t will need to include that file, conditioned on
>> HAVE_SYS_SOCKET_H.  Perhaps this:
>>
>> #ifdef HAVE_SYS_SOCKET_H
>> # include <sys/socket.h>
>> #endif
>>
>> should go into modules/socklen's Include statement then?
>
> Yes, I agree.

On second thought, I think it should be #include <sys/socket.h>.  If
you need portability to a platform that doesn't have sys/socket.h,
there is the sys_socket module.

I installed this patch:

Index: modules/socklen
===================================================================
RCS file: /sources/gnulib/gnulib/modules/socklen,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- modules/socklen     15 Dec 2005 09:13:08 -0000      1.2
+++ modules/socklen     17 Jan 2006 17:22:37 -0000      1.3
@@ -12,6 +12,7 @@ gl_TYPE_SOCKLEN_T
 Makefile.am:
 
 Include:
+#include <sys/socket.h>
 
 License:
 unlimited

> Similarly, I propose to modify modules/ssize as follows:

Looks good, please install.

> *** modules/ssize_t     15 Aug 2005 12:12:53 -0000      1.2
> --- modules/ssize_t     9 Jan 2006 20:42:54 -0000
> ***************
> *** 12,17 ****
> --- 12,18 ----
>   Makefile.am:
>   
>   Include:
> + #include <sys/types.h>
>   
>   License:
>   unlimited
>
>
> Bruno




reply via email to

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