[PATCH] <netdb.h> SUSv3 compliance

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] <netdb.h> SUSv3 compliance

Yaakov (Cygwin/X)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

SUSv3&4 state:

> Inclusion of the <netdb.h> header may also make visible all symbols
> from <netinet/in.h>, <sys/socket.h>, and <inttypes.h>.

Having come across packages that assume this (at least in part), I would
like to make ours compatible.

<inttypes.h> must #include <stdint.h> per SUSv3, so that should be a
safe switch.  <cygwin/in.h> already has a #include <cygwin/socket.h>,
but I don't know if you want to assume that or not.

Patch attached.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAknUUWIACgkQpiWmPGlmQSMI9ACgkSxq6DAf7aedISjvD7FE1Ocm
AU4AoJ4LRzKDN3IU3bhP2aBwFFysct1Q
=DMTr
-----END PGP SIGNATURE-----

2009-04-02  Yaakov Selkowitz  <[hidden email]>

        * include/netdb.h: #include <inttypes.h>, <netinet/in.h>,
        and <sys/socket.h> per SUSv3.


Index: include/netdb.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/netdb.h,v
retrieving revision 1.10
diff -u -r1.10 netdb.h
--- include/netdb.h 1 Feb 2007 15:54:40 -0000 1.10
+++ include/netdb.h 2 Apr 2009 05:46:09 -0000
@@ -63,8 +63,9 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
-#include <cygwin/socket.h>
+#include <inttypes.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
 
 /*
  * Structures returned by network data base library.  All addresses are
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] <netdb.h> SUSv3 compliance

Corinna Vinschen-2
On Apr  2 00:47, Yaakov S wrote:

> SUSv3&4 state:
>
> > Inclusion of the <netdb.h> header may also make visible all symbols
> > from <netinet/in.h>, <sys/socket.h>, and <inttypes.h>.
>
> Having come across packages that assume this (at least in part), I would
> like to make ours compatible.
>
> <inttypes.h> must #include <stdint.h> per SUSv3, so that should be a
> safe switch.  <cygwin/in.h> already has a #include <cygwin/socket.h>,
> but I don't know if you want to assume that or not.
>
> Patch attached.

Applied with a tweak.  The inclusion of netinet/in.h clashes with the
inclusion of winsock2.h in case of a couple of datatype.  So this
header must not be included when building Cygwin itself.


Thanks,
Corinna

--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat