Wide character types

Václav Zeman vhaisman at gmail.com
Thu Jun 7 11:20:36 UTC 2012


On 6 June 2012 12:03, Andrew Turner wrote:
> I've been working on getting the ARM EABI working with FreeBSD.
>
> As part of the EABI spec the Procedure Call Standard for the ARM
> Architecture (AAPCS) defines wchar_t as either an unsigned int or an
> unsigned short with the former as the preferred type. FreeBSD defines
> wchar_t as a __wchar_t, which is defined as a __ct_rune_t, which is
> defined as an int.
>
> wint_t and rune_t are also defined in terms of __ct_rune_t. wint_t must
> be a signed type as it needs to hols a WEOF which is defined as -1.
>
> The type of rune_t appears to need to be the same as wint_t as the tow*
> and isw* functions are defined as taking a wint_t by the documentation
> but __ct_rune_t in the code and compare this value against __rune_t
> values.
>
> My question is am I correct in thinking rune_t and wint_t should be
> defined as __ct_rune_t with __ct_rune_t defined as an int while wchar_t
> should be defined as an unsigned int in ARM EABI and defined as an int
> elsewhere?
Non-authoritative answer: I think you conclusion is correct. I think
that freebsd-standards at freebsd.org would be a better audience for this
kind of question.

-- 
VZ


More information about the freebsd-hackers mailing list