From 50c77c6e8b152e463f99c4e9225f5603c02d979c Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 21 May 2013 19:59:37 +0000 Subject: Add . The header, part of C11, adds a small number of utility functions for 16/32-bit "universal" characters, which may or may not be UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight wrappers around wcrtomb() and mbrtowc(). While there, also add (non-yet-standard) _l functions, similar to the ones we already have for the other locale-dependent functions. Reviewed by: theraven --- sys/sys/_types.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/sys') diff --git a/sys/sys/_types.h b/sys/sys/_types.h index 27ecaf4f0e12..e47749faaa90 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -89,6 +89,12 @@ typedef int __ct_rune_t; /* arg type for ctype funcs */ typedef __ct_rune_t __rune_t; /* rune_t (see above) */ typedef __ct_rune_t __wint_t; /* wint_t (see above) */ +/* Clang already provides these types as built-ins, but only in C++ mode. */ +#if !defined(__clang__) || !defined(__cplusplus) +typedef __uint_least16_t __char16_t; +typedef __uint_least32_t __char32_t; +#endif + typedef __uint32_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ -- cgit v1.2.3