bug-gnulib
[Top][All Lists]
Advanced

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

Re: Windows fixes for sockpfaf


From: Simon Josefsson
Subject: Re: Windows fixes for sockpfaf
Date: Thu, 06 Jul 2006 15:57:10 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Eric Blake <address@hidden> writes:

> Both patches installed, as proposed.

Thanks!

>> However, I'm not sure this is the Right Thing.  Why doesn't it work to
>> include winsock2.h under cygwin?  I.e., what's in your config.log when
>> the above happen?
>
> On cygwin, you have a choice for socket implementations.  Either you
> use POSIX sockets, in which case you should never include winsock2.h
> because POSIX doesn't specify it.  Or you use winsock (which makes
> your application unportable), and you should never use sys/socket.h
> since Windows doesn't provide it.  The cygwin headers are hard-coded
> to reject inclusion of both methods, because they are vastly
> incompatible.  However, the cygwin community tends to frown on
> including winsock, because then your application can only be used in
> cygwin, as opposed to porting to arbitrary POSIX-like platforms.

Ok, thanks, that's a good summary of things.

I don't have a patch that I believe would improve the situation, so
let's leave it as-is.

>> Maybe there should be a USE_NATIVE_WIN32 define, which could be a
>> configure-time parameter, i.e. --enable-native-win32, that toggles
>> whether it should try to include winsock2.h etc or not.
>
> Maybe, but since the cygwin community tends to frown on raw usage of
> winsock as being nonportable, it probably won't be used.  It's much
> easier if on cygwin, you pretend that winsock2.h doesn't even exist,
> and stick with the POSIX way of doing sockets.

Right.

>> I'm worried that the logic you are proposing will break if MinGW will
>> get a sys/socket.h at some time.
>
> Valid point, although as long as we filter all .m4 tests of
> sys/socket through gl_HEADER_SYS_SOCKET, we will only have one point
> to update if our current approach breaks.  I don't follow mingw
> closely enough to know if this is ever likely to happen, but I would
> argue that we don't need to worry about it unless it does happen.

Yup.

I installed the patch below, to have one canonical module for
sockpfaf.m4.

2006-07-06  Simon Josefsson  <address@hidden>

        * modules/sys_socket (Files): Add m4/sockpfaf.m4 (this module is
        now the canonical place for the M4 file).

        * modules/getaddrinfo (Files): Remove m4/sockpfaf.m4, we get it
        from the sys_socket dependency now.

        * modules/inet_pton (Files): Ditto.

        * modules/inet_ntop (Files): Ditto.

Index: modules/getaddrinfo
===================================================================
RCS file: /sources/gnulib/gnulib/modules/getaddrinfo,v
retrieving revision 1.8
diff -u -p -r1.8 getaddrinfo
--- modules/getaddrinfo 5 Jul 2006 18:10:56 -0000       1.8
+++ modules/getaddrinfo 6 Jul 2006 13:51:35 -0000
@@ -6,7 +6,6 @@ lib/getaddrinfo.h
 lib/getaddrinfo.c
 lib/gai_strerror.c
 m4/getaddrinfo.m4
-m4/sockpfaf.m4
 
 Depends-on:
 restrict
Index: modules/inet_pton
===================================================================
RCS file: /sources/gnulib/gnulib/modules/inet_pton,v
retrieving revision 1.1
diff -u -p -r1.1 inet_pton
--- modules/inet_pton   21 Jun 2006 09:59:49 -0000      1.1
+++ modules/inet_pton   6 Jul 2006 13:51:35 -0000
@@ -5,7 +5,6 @@ Files:
 lib/inet_pton.h
 lib/inet_pton.c
 m4/inet_pton.m4
-m4/sockpfaf.m4
 
 Depends-on:
 restrict
Index: modules/inet_ntop
===================================================================
RCS file: /sources/gnulib/gnulib/modules/inet_ntop,v
retrieving revision 1.4
diff -u -p -r1.4 inet_ntop
--- modules/inet_ntop   20 Jan 2006 12:59:10 -0000      1.4
+++ modules/inet_ntop   6 Jul 2006 13:51:35 -0000
@@ -5,7 +5,6 @@ Files:
 lib/inet_ntop.h
 lib/inet_ntop.c
 m4/inet_ntop.m4
-m4/sockpfaf.m4
 
 Depends-on:
 restrict
Index: modules/sys_socket
===================================================================
RCS file: /sources/gnulib/gnulib/modules/sys_socket,v
retrieving revision 1.3
diff -u -p -r1.3 sys_socket
--- modules/sys_socket  23 Jun 2006 19:27:17 -0000      1.3
+++ modules/sys_socket  6 Jul 2006 13:51:35 -0000
@@ -4,6 +4,7 @@ A <sys/socket.h> for systems lacking it.
 Files:
 lib/socket_.h
 m4/sys_socket_h.m4
+m4/sockpfaf.m4
 
 Depends-on:
 




reply via email to

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