_mbtowc_r with direct call to __mbtowc.
* libc/stdio/vfscanf.c: Ditto.
* libc/stdlib/btowc.c: Include local.h. Replace call to _mbtowc_r
with direct call to __mbtowc.
* libc/stdlib/mblen.c: Ditto.
* libc/stdlib/mblen_r.c: Ditto.
* libc/stdlib/mbrtowc.c: Ditto.
* libc/stdlib/mbstowcs_r.c: Ditto.
* libc/stdlib/mbtowc.c: Ditto.
* libc/stdlib/wcrtomb.c: Include local.h. Replace call to _wctomb_r
with direct call to __wctomb.
* libc/stdlib/wcsnrtombs.c: Ditto.
(_wcsnrtombs_r): Ditto.
* libc/stdlib/wcstombs_r.c: Ditto.
* libc/stdlib/wctob.c: Ditto.
* libc/stdlib/wctomb.c: Ditto.
* libc/stdlib/mbrtowc.c (mbrtowc): Implement independently from
_mbrtowc_r, unless PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__ are
defined.
* libc/stdlib/wcrtomb.c (wcrtomb): Implement independently from
_wcrtomb_r, unless PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__ are
defined.
* libc/stdlib/mbtowc_r.c (__utf8_mbtowc): Drop unnecessary test for
ch >= 0.
* libc/stdlib/wctomb_r.c (_wctomb_r): When checking single-byte
charset, cast wchar to size_t in case wchar_t is signed.
* libc/stdlib/wctomb.c (wctomb): Add similar single-byte check.
* libc/include/sys/reent.h (_REENT_INIT_PTR): New macro for
initializing a struct _reent that has been dynamically allocated.
(_REENT_CHECK_MISC): New macro that checks _misc struct for
_REENT_SMALL and does nothing otherwise.
(_REENT_STRTOK_LAST): New macro for reentrant strtok.
(_REENT_MBLEN_STATE): New macro for reentrant mblen.
(_REENT_MBTOWC_STATE): New macro for reentrant mbtowc.
(_REENT_WCTOMB_STATE): New macro for reentrant wctomb.
[_REENT_SMALL](struct _misc_reent): New structure containing
miscellaneous reentrant areas needed by newlib.
[_REENT_SMALL](struct _reent): Add _misc pointer.
[_REENT_SMALL](_REENT_INIT_MISC): New macro.
* libc/string/strtok (strtok): Change to use _REENT_CHECK_MISC
and _REENT_STRTOK_LAST macros.
* libc/stdlib/mblen (mblen): Change to use _REENT_CHECK_MISC
and _REENT_MBLEN_STATE macros.
* libc/stdlib/mbtowc (mbtowc): Change to use _REENT_CHECK_MISC
and _REENT_MBTOWC_STATE macros.
* libc/stdlib/wctomb (wctomb): Change to use _REENT_CHECK_MISC
and _REENT_WCTOMB_STATE macros.