[PATCH 1/2] Provide __intmax_t and __uintmax_t
Sebastian Huber
sebastian.huber@embedded-brains.de
Tue Oct 18 08:04:00 GMT 2016
----- Am 17. Okt 2016 um 17:03 schrieb Corinna Vinschen vinschen@redhat.com:
> Hi Sebastian,
>
> On Oct 10 08:43, Sebastian Huber wrote:
>> Provide __intmax_t and __uintmax_t via <machine/_default_types> for
>> FreeBSD compatibility.
>>
>> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
>> ---
>> newlib/libc/include/machine/_default_types.h | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/newlib/libc/include/machine/_default_types.h
>> b/newlib/libc/include/machine/_default_types.h
>> index ffc646d..eaa6cec 100644
>> --- a/newlib/libc/include/machine/_default_types.h
>> +++ b/newlib/libc/include/machine/_default_types.h
>> @@ -211,6 +211,15 @@ typedef long __intptr_t;
>> typedef unsigned long __uintptr_t;
>> #endif
>>
>> +#ifdef __INTMAX_TYPE__
>> +typedef __INTMAX_TYPE__ __intmax_t;
>> +#ifdef __UINTMAX_TYPE__
>> +typedef __UINTMAX_TYPE__ __uintmax_t;
>> +#else
>> +typedef unsigned __INTMAX_TYPE__ __uintmax_t;
>> +#endif
>> +#endif
>> +
>
> This doesn't match the definition of the non-underscored intmax_t and
> uintmax_t from stdint.h. Is that intentional? If not, wouldn't it
> make sense to align the definitions? Or better, let's define __intmax_t
> and __uintmax_t in machine/_default_types.h according to the current
> definition in stdint.h and then use __intmax_t/__uintmax_t to define
> intmax_t/uintmax_t.
Yes, good point. I will fix this and send a second version in a couple of days.
More information about the Newlib
mailing list