Yaakov (Cygwin/X | 2 Apr 2009 07:47
Picon
Gravatar

[PATCH] <netdb.h> SUSv3 compliance


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
Corinna Vinschen | 2 Apr 2009 10:49
Favicon

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

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

Yaakov (Cygwin/X | 3 Apr 2009 05:11
Picon
Gravatar

[PATCH] <asm/byteorder.h> missing prototypes warning


This is similar in concept to the <stdio.h> patch I just posted to
newlib <at> .  It looks like I mistakenly removed the prototypes when I was
trying to fix the C99 inline issue in <asm/byteorder.h>.

Since this makes four lines which need the C99 inline workaround, I
decided to make a macro similar to that in <stdio.h>.  I didn't use the
same macro name, since I didn't want to deal with a possible collision
with, or dependency on, <stdio.h>.  Perhaps there is a better way of
dealing with this; I'm certainly open to ideas.

Patch attached.

Yaakov

Dave Korn | 3 Apr 2009 09:01

Re: [PATCH] <asm/byteorder.h> missing prototypes warning

Yaakov (Cygwin/X) wrote:

> This is similar in concept to the <stdio.h> patch I just posted to
> newlib <at> .  It looks like I mistakenly removed the prototypes when I was
> trying to fix the C99 inline issue in <asm/byteorder.h>.
> 
> Since this makes four lines which need the C99 inline workaround, I
> decided to make a macro similar to that in <stdio.h>.  I didn't use the
> same macro name, since I didn't want to deal with a possible collision
> with, or dependency on, <stdio.h>.  Perhaps there is a better way of
> dealing with this; I'm certainly open to ideas.

  I'll suggest upstream that since this macro trick is going to spread
increasingly to more and more header files, maybe we should actually provide a
predefined preprocessor macro for it.  If it's acceptable, I'll backport
support to the cygwin distro version.

  Maybe we can call it __extern__ (so it looks like a c99-compatible extension
keyword and doesn't cause problems for non-GCC compilers) and define it as
"'extern' if !__GNUC_STDC_INLINE__".  That might work well.

    cheers,
      DaveK

Dave Korn | 3 Apr 2009 10:15

Re: [PATCH] <asm/byteorder.h> missing prototypes warning

Dave Korn wrote:

>   Maybe we can call it __extern__ (so it looks like a c99-compatible extension
> keyword and doesn't cause problems for non-GCC compilers)

  ENOCOFFEE.  That's not a c99 extension, it's a gcc extension.  Dur me!

    cheers,
      DaveK

Corinna Vinschen | 3 Apr 2009 10:18
Favicon

Re: [PATCH] <asm/byteorder.h> missing prototypes warning

On Apr  3 09:15, Dave Korn wrote:
> Dave Korn wrote:
> 
> >   Maybe we can call it __extern__ (so it looks like a c99-compatible extension
> > keyword and doesn't cause problems for non-GCC compilers)
> 
>   ENOCOFFEE.  That's not a c99 extension, it's a gcc extension.  Dur me!

Who on earth decided that a redundant declaration of an inline function
is necessary to avoid a useless warning?

Corinna

--

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

Corinna Vinschen | 3 Apr 2009 10:26
Favicon

Re: [PATCH] <asm/byteorder.h> missing prototypes warning

On Apr  2 22:11, Yaakov S wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> This is similar in concept to the <stdio.h> patch I just posted to
> newlib <at> .  It looks like I mistakenly removed the prototypes when I was
> trying to fix the C99 inline issue in <asm/byteorder.h>.
> 
> Since this makes four lines which need the C99 inline workaround, I
> decided to make a macro similar to that in <stdio.h>.  I didn't use the
> same macro name, since I didn't want to deal with a possible collision
> with, or dependency on, <stdio.h>.  Perhaps there is a better way of
> dealing with this; I'm certainly open to ideas.
> 
> Patch attached.

Wouldn't it be better to move newlib's _ELIDABLE_INLINE definition to
some nicely matchin header like _ansi.h and then use it wherever it
fits?

Corinna

--

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

Dave Korn | 3 Apr 2009 11:18

Re: [PATCH] <asm/byteorder.h> missing prototypes warning

Corinna Vinschen wrote:

> Wouldn't it be better to move newlib's _ELIDABLE_INLINE definition to
> some nicely matchin header like _ansi.h and then use it wherever it
> fits?

  I think you're right.  Can one of you two please take care of it?  I've got
a bit of a load on right now what with gcc back in stage1.

    cheers,
      DaveK

Dave Korn | 3 Apr 2009 15:18

[PATCH] Add uchar.h

Dave Korn wrote:
>
>  I've got a bit of a load on right now what with gcc back in stage1.

  However, as part of dealing with that I did try throwing together one of
these.  I wrote this from scratch based solely on reading n1040; it's
skeletal, but at least provides the two new unicode typedefs.  Want it?

winsup/cygwin/ChangeLog

	* include/uchar.h:  New file.

    cheers,
      DaveK
Attachment (add-uchar-h.diff): text/x-c, 1360 bytes
Corinna Vinschen | 3 Apr 2009 16:35
Favicon

Re: [PATCH] Add uchar.h

On Apr  3 14:18, Dave Korn wrote:
> Dave Korn wrote:
> >
> >  I've got a bit of a load on right now what with gcc back in stage1.
> 
>   However, as part of dealing with that I did try throwing together one of
> these.  I wrote this from scratch based solely on reading n1040; it's
> skeletal, but at least provides the two new unicode typedefs.  Want it?

Care to explain?

- What's n1040?

- I don't see these defines anywhere near POSIX-1.2008.

Corinna

--

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


Gmane