1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6 /* ISO C1x Unicode utilities
7 * Based on ISO/IEC SC22/WG14 9899 TR 19769 (SC22 N1326)
8 *
9 * THIS SOFTWARE IS NOT COPYRIGHTED
10 *
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
13 *
14 * This code is distributed in the hope that it will be useful but
15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16 * DISCLAIMED. This includes but is not limited to warranties of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 * Date: 2011-09-27
20 */
21
22 #include <errno.h>
23 #include <uchar.h>
24
mbrtoc16(char16_t * __restrict__ pc16,const char * __restrict__ s,size_t n,mbstate_t * __restrict__ state)25 size_t mbrtoc16 (char16_t *__restrict__ pc16,
26 const char *__restrict__ s,
27 size_t n,
28 mbstate_t *__restrict__ state)
29 {
30 /* wchar_t should compatible to char16_t on Windows */
31 return mbrtowc((wchar_t *)pc16, s, n, state);
32 }
33
34