From 74dc547e24c143e53bdcfdc02a718cf09abbf0f2 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Sun, 24 Jun 2012 04:15:58 +0000 Subject: Make the wchar_t type machine dependent. This is required for ARM EABI. Section 7.1.1 of the Procedure Call for the ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an unsigned short with the former preferred. Because of this requirement we need to move the definition of __wchar_t to a machine dependent header. It also cleans up the macros defining the limits of wchar_t by defining __WCHAR_MIN and __WCHAR_MAX in the same machine dependent header then using them to define WCHAR_MIN and WCHAR_MAX respectively. Discussed with: bde --- sys/arm/include/_types.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/arm/include/_types.h') diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h index 338c19c11136..7915d0b7cafd 100644 --- a/sys/arm/include/_types.h +++ b/sys/arm/include/_types.h @@ -105,6 +105,16 @@ typedef __uint32_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; +#ifdef __ARM_EABI__ +typedef unsigned int __wchar_t; +#define __WCHAR_MIN 0 /* min value for a wchar_t */ +#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ +#else +typedef int __wchar_t; +#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ +#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ +#endif + /* * Unusual type definitions. */ -- cgit v1.2.3