RTEMS patch sweep: *types.h

Ralf Corsepius ralf.corsepius@rtems.org
Fri Mar 4 10:50:00 GMT 2005

On Fri, 2005-03-04 at 11:04 +0100, Corinna Vinschen wrote:
> On Mar  4 10:36, Ralf Corsepius wrote:
> > I am proposing the patch below, which is supposed to do what I described
> > above.
> > 
> > I tried to test with linux (FC3), but as mentioned before, I am not able
> > to build any version of newlib-0.13.x.
> > 
> > I did not test with Cygwin, but I am confident this patch won't change
> > or break anything for Cygwin.
> It just must not collide with stdint.h, which Cygwin has it's own file,

Right, this needs to be checked - I'll do so ASAP, and inform you should
I find something (I already checked once, several weeks ago, so I would
not expect conflicts, but ...)

FYI: RTEMS also has stdint.h (+inttypes.h) of its own, based on the same
working principles as my machine/_types.h. 

I plan to add it to the rtems specific headers in near future (the
details depend on how this patch (machine/_types.h) is integrated into

I think is its general enough to be applicable as a general header in
newlib, so I am considering to propose it as general header in newlib,
which would raise conflicts with Cygwin, but I won't insist on it.

> and it shouldn't collide with the following snippet in cygwin/types.h
> (included through sys/types.h):
>   #ifndef __u_int8_t_defined
>   #define __u_int8_t_defined
>   typedef unsigned char u_int8_t;
>   #endif
>   #ifndef __u_int16_t_defined
>   #define __u_int16_t_defined
>   typedef __uint16_t u_int16_t;
>   #endif
>   #ifndef __u_int32_t_defined
>   #define __u_int32_t_defined
>   typedef __uint32_t u_int32_t;
>   #endif
>   #ifndef __u_int64_t_defined
>   #define __u_int64_t_defined
>   typedef __uint64_t u_int64_t;
>   #endif
>   #ifndef __register_t_defined
>   #define __register_t_defined
>   typedef __int32_t register_t;
>   #endif
> Then it should be ok, AFAICS.  Can you double check, please?
AFAIS, it does not conflict.

u_intXX_t types are proprietary BSD types, which BSD defines in
sys/types.h and newlib doesn't define in general.

A corresponding "#ifdef __rtems__" block is in newlib's sys/types.h, so
it should not conflict with Cygwin.

> As far as the above definitions from cygwin/types.h are concerned, I'm
> open for inclusion into sys/types.h.
Well, AFAIS, the cygwin block you cite above, is sufficiently similar
to the corresponding RTEMS block in newlib, that it can easily be merged
into newlib's sys/types.h (i.e. to merge your block and the rtems block
into one).


More information about the Newlib mailing list