Index: include/wchar.h =================================================================== --- include/wchar.h (revision 237150) +++ include/wchar.h (working copy) @@ -88,10 +88,8 @@ #define _WINT_T_DECLARED #endif -#ifndef WCHAR_MIN -#define WCHAR_MIN __INT_MIN -#define WCHAR_MAX __INT_MAX -#endif +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX #ifndef WEOF #define WEOF ((wint_t)-1) Index: sys/sys/_types.h =================================================================== --- sys/sys/_types.h (revision 237150) +++ sys/sys/_types.h (working copy) @@ -81,13 +81,12 @@ * * NOTE: rune_t is not covered by ANSI nor other standards, and should not * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and - * rune_t must be the same type. Also, wint_t must be no narrower than - * wchar_t, and should be able to hold all members of the largest - * character set plus one extra value (WEOF), and must be at least 16 bits. + * rune_t must be the same type. Also, wint_t should be able to hold all + * members of the largest character set plus one extra value (WEOF), and + * must be at least 16 bits. */ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ -typedef __ct_rune_t __wchar_t; /* wchar_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ typedef __uint32_t __dev_t; /* device number */ Index: sys/sys/stdint.h =================================================================== --- sys/sys/stdint.h (revision 237150) +++ sys/sys/stdint.h (working copy) @@ -71,4 +71,8 @@ #define __WORDSIZE 32 #endif +/* Limits of wchar_t. */ +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX + #endif /* !_SYS_STDINT_H_ */ Index: sys/arm/include/_stdint.h =================================================================== --- sys/arm/include/_stdint.h (revision 237150) +++ sys/arm/include/_stdint.h (working copy) @@ -149,12 +149,6 @@ /* Limit of size_t. */ #define SIZE_MAX UINT32_MAX -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX Index: sys/arm/include/_types.h =================================================================== --- sys/arm/include/_types.h (revision 237150) +++ sys/arm/include/_types.h (working copy) @@ -105,6 +105,12 @@ typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; +#ifdef __ARM_EABI__ +typedef unsigned int __wchar_t; +#else +typedef int __wchar_t; +#endif + /* * Unusual type definitions. */ Index: sys/arm/include/_limits.h =================================================================== --- sys/arm/include/_limits.h (revision 237150) +++ sys/arm/include/_limits.h (working copy) @@ -78,6 +78,14 @@ #define __QUAD_MAX __LLONG_MAX /* max value for a quad_t */ #define __QUAD_MIN __LLONG_MIN /* min value for a quad_t */ +#ifdef __ARM_EABI__ +#define __WCHAR_MIN (0) +#define __WCHAR_MAX __UINT_MAX +#else +#define __WCHAR_MIN __INT_MIN +#define __WCHAR_MAX __INT_MAX +#endif + #define __LONG_BIT 32 #define __WORD_BIT 32