]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFstable/10 r250883,r251314:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 5 Dec 2015 22:56:57 +0000 (22:56 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 5 Dec 2015 22:56:57 +0000 (22:56 +0000)
commitf0ef7ff2f927f332046cd8cb5941ca49ed717131
tree0014cdb8a6c7d507e1197d6ab01549e3220cb78c
parentde1217990478f4ebfa62dbc611b12812acd60040
MFstable/10 r250883,r251314:

r250883 (by ed):

Add <uchar.h>.

The <uchar.h> 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

r251314 (by ed):

Add libiconv based versions of *c16*() and *c32*().

I initially thought wchar_t was locale independent, but this seems to be
only the case on Linux. This means that we cannot depend on the *wc*()
routines to implement *c16*() and *c32*(). Instead, use the Citrus
libiconv that is part of libc.

I'll see if there is anything I can do to make the existing functions
somewhat useful in case the system is built without libiconv in the
nearby future. If not, I'll simply remove the broken implementations.

Reviewed by: jilles, gabor

git-svn-id: svn://svn.freebsd.org/base/stable/9@291875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
24 files changed:
include/Makefile
include/stdatomic.h
include/uchar.h [new file with mode: 0644]
include/xlocale/Makefile
include/xlocale/_uchar.h [new file with mode: 0644]
lib/libc/locale/Makefile.inc
lib/libc/locale/Symbol.map
lib/libc/locale/c16rtomb.c [new file with mode: 0644]
lib/libc/locale/c16rtomb_iconv.c [new file with mode: 0644]
lib/libc/locale/c32rtomb.c [new file with mode: 0644]
lib/libc/locale/c32rtomb_iconv.c [new file with mode: 0644]
lib/libc/locale/cXXrtomb_iconv.h [new file with mode: 0644]
lib/libc/locale/mbrtoc16.c [new file with mode: 0644]
lib/libc/locale/mbrtoc16_iconv.c [new file with mode: 0644]
lib/libc/locale/mbrtoc32.c [new file with mode: 0644]
lib/libc/locale/mbrtoc32_iconv.c [new file with mode: 0644]
lib/libc/locale/mbrtocXX_iconv.h [new file with mode: 0644]
lib/libc/locale/mbrtowc.3
lib/libc/locale/wcrtomb.3
lib/libc/locale/xlocale_private.h
sys/sys/_types.h
tools/regression/lib/libc/locale/Makefile
tools/regression/lib/libc/locale/test-c16rtomb.c [new file with mode: 0644]
tools/regression/lib/libc/locale/test-mbrtoc16.c [new file with mode: 0644]