[PATCH] Maybe change __size_t definition in <stddef.h>?

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 15 11:01:07 UTC 2016



On 15/04/16 12:23, Richard Biener wrote:
> On Fri, Apr 15, 2016 at 11:44 AM, Sebastian Huber
> <sebastian.huber at embedded-brains.de>  wrote:
>> >I work currently on a better FreeBSD compatibility for Newlib.  For
>> >RTEMS we use the network, USB, SD/MMC stacks from FreeBSD.  It would be
>> >nice to use <sys/types.h>, etc. from Newlib directly to compile FreeBSD
>> >user and kernel space files.
>> >
>> >Various FreeBSD source and header files need a typedef __size_t via
>> ><sys/_types.h>.  Unfortunately the GCC provided <stddef.h> uses
>> >
>> >     #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
>> >       || defined(__DragonFly__) \
>> >       || defined(__FreeBSD_kernel__)
>> >     /* __size_t is a typedef on FreeBSD 5, must not trash it. */
>> >     #elif defined (__VMS__)
>> >     /* __size_t is also a typedef on VMS.  */
>> >     #else
>> >     #define __size_t
> This looks odd - maybe it was meant to be a #undef?  OTOH there are
> a whole lot of other similar cases there which do not make sense to me...

No, in case __size_t is defined, then we don't end up in this spot. 
stddef.h tests for various guard defines and if none of them is defined, 
then it typedefs size_t and defines all the guard defines to nothing, 
except for __size_t on some targets.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list