1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00

Add iswctype wcwidth function code

Submitted by:	clkao@clkao.org
Reviewed by:	keichii
Obtained from:	NetBSD
MFC after:	1 month
This commit is contained in:
Michael C . Wu 2002-08-16 13:45:23 +00:00
parent c3121a34a0
commit dff784192b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101985

View File

@ -211,3 +211,13 @@ towupper(wc)
{
return (__toupper(wc));
}
#undef wcwidth
int
wcwidth(wc)
wchar_t wc;
{
int width = (unsigned)__maskrune((wc), _CTYPE_SWM) >> _CTYPE_SWS;
return width ? width : iswprint(wc);
}