newlib: wide char support
git-svn-id: svn://kolibrios.org@6607 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
22
contrib/sdk/sources/newlib/libc/stdlib/mbrlen.c
Normal file
22
contrib/sdk/sources/newlib/libc/stdlib/mbrlen.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <reent.h>
|
||||
#include <newlib.h>
|
||||
#include <wchar.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
size_t
|
||||
mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
if (ps == NULL)
|
||||
{
|
||||
struct _reent *reent = _REENT;
|
||||
|
||||
_REENT_CHECK_MISC(reent);
|
||||
ps = &(_REENT_MBRLEN_STATE(reent));
|
||||
}
|
||||
#endif
|
||||
|
||||
return mbrtowc(NULL, s, n, ps);
|
||||
}
|
Reference in New Issue
Block a user