aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2012-06-24 04:15:58 +0000
committerAndrew Turner <andrew@FreeBSD.org>2012-06-24 04:15:58 +0000
commit74dc547e24c143e53bdcfdc02a718cf09abbf0f2 (patch)
treee552f71c40d544605624d7aef2aa2206548a6f01 /sys/sys
parentf745b1635901f37c921bc27de9aa80a6edc4d5fb (diff)
downloadsrc-74dc547e24c143e53bdcfdc02a718cf09abbf0f2.tar.gz
src-74dc547e24c143e53bdcfdc02a718cf09abbf0f2.zip
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
Notes
Notes: svn path=/head/; revision=237517
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/_types.h9
-rw-r--r--sys/sys/stdint.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index c59afd31cb55..27ecaf4f0e12 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -80,14 +80,13 @@ typedef int __cpusetid_t; /* cpuset identifier. */
* ANSI C), but they use __ct_rune_t instead of int.
*
* 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.
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and
+ * 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 */
diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h
index aa5ac81d1017..762e8795496a 100644
--- a/sys/sys/stdint.h
+++ b/sys/sys/stdint.h
@@ -71,4 +71,8 @@ typedef __uintmax_t uintmax_t;
#define __WORDSIZE 32
#endif
+/* Limits of wchar_t. */
+#define WCHAR_MIN __WCHAR_MIN
+#define WCHAR_MAX __WCHAR_MAX
+
#endif /* !_SYS_STDINT_H_ */