As this adds (yet more stupid) public symbols to libc, I want to make sure this is acceptable before going further with testing on linux cross build.
__mb_sb_limit which defines the highest character that isctype
functions can process describes the global locale as it was introduced
before the xlocale work. It becomes a problem when global locale is set
to the one with e.g. UTF-8 encoding which sets __mb_sb_limit to 128 from
the original 256, and if per-thread locale is set to e.g. ISO8859-1 one,
all of the isctype functions will fail early for [128-255] range even
if the type check should succeed for a character.
To fix this, make isctype functions query the per-thread locale via the
added ___mb_sb_limit function. Sadly this requires making that symbol
public to not expose even more of xlocale internals as isctype helper
functions are inlined.
The change broke bootstrap localedef build (on FreeBSD, Linux cross
buld not tested yet) as it was including _ctype.h from the source tree
which it should not really do anyway. Fix this by extracting the needed
_CTYPE_* defines from the include/_ctype.h.
PR: 265950