[PATCH v3] Merge parts of <sys/time.h> from FreeBSD
Corinna Vinschen
vinschen@redhat.com
Mon Jul 6 18:10:00 GMT 2015
On Jul 6 13:08, Sebastian Huber wrote:
>
>
> On 06/07/15 10:08, Corinna Vinschen wrote:
> >Hi Marco,
> >
> >On Jul 5 16:33, Marco Atzeri wrote:
> >>On 3/13/2015 1:24 PM, Corinna Vinschen wrote:
> >>>Hi Sebastian,
> >>>
> >>>On Mar 13 11:00, Sebastian Huber wrote:
> >>>>Merge parts of the latest <sys/time.h> from FreeBSD to Newlib. This has
> >>>>two reasons.
> >>>This patch also allowed to remove a Cygwin specific piece of code.
> >>>I now pushed your patch as well as the Cygwin ones.
> >>>
> >>>Thanks,
> >>>Corinna
> >>>
> >>
> >>with the current settings, on cygwin with _GNU_SOURCE on
> >>/usr/include/sys/time.h
> >>
> >>bintime_mul(struct bintime *_bt, u_int _x)
> >>is included but
> >>
> >>u_int is not defined
> >Thanks, but you forgot to paste this detail from your mail to the
> >Cygwin list:
> >
> >>u_int is defined in
> >> /usr/include/sys/types.h
> >>and
> >> /usr/include/sys/time.h
> >>includes it, but it is coveread by a
> >>
> >> # ifndef _POSIX_SOURCE
> >Also your project defines _POSIX_SOURCE.
> >
> >So while u_int is guarded !_POSIX_SOURCE, the bintime_mul inline function
> >using it is guarded __BSD_VISIBLE.
> >
> >Sebastian, the easy way out would be to redefine bintime_mul to use
> >and "unsigned int" as second parameter.
> >
> >OTOH, shouldn't the affected types in sys/types.h guarded __BSD_VISIBLE,
> >too, instead? They are on FreeBSD, afaics.
>
> In FreeBSD sys/types.h we have:
>
> #if __BSD_VISIBLE
> typedef unsigned char u_char;
> typedef unsigned short u_short;
> typedef unsigned int u_int;
> typedef unsigned long u_long;
> #ifndef _KERNEL
> typedef unsigned short ushort; /* Sys V compatibility */
> typedef unsigned int uint; /* Sys V compatibility */
> #endif
> #endif
>
> So this fits well with the bintime_mul(struct bintime *_bt, u_int _x).
> [...]
> So this uses the _POSIX_SOURCE define. I would adjust this to use the
> __BSD_VISIBLE instead like on FreeBSD.
Done.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20150706/2fb65645/attachment.sig>
More information about the Newlib
mailing list