X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/3d9156a7a519a5e3aa1b92e9d9d4b991f1aed7ff..2be56ee90c5c5bee77895b8787a43e894249002b:/locale/FreeBSD/wcrtomb.c diff --git a/locale/FreeBSD/wcrtomb.c b/locale/FreeBSD/wcrtomb.c index 4d7b115..81b99d4 100644 --- a/locale/FreeBSD/wcrtomb.c +++ b/locale/FreeBSD/wcrtomb.c @@ -27,15 +27,23 @@ #include __FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.8 2004/05/12 14:09:04 tjr Exp $"); +#include "xlocale_private.h" + #include #include "mblocal.h" size_t -wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) +wcrtomb_l(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, + locale_t loc) { - static mbstate_t mbs; - + NORMALIZE_LOCALE(loc); if (ps == NULL) - ps = &mbs; - return (__wcrtomb(s, wc, ps)); + ps = &loc->__mbs_wcrtomb; + return (loc->__lc_ctype->__wcrtomb(s, wc, ps, loc)); +} + +size_t +wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) +{ + return wcrtomb_l(s, wc, ps, __current_locale()); }