6fbeb6a3f0
* mingwex/wcrtomb.c: New file. * mingwex/btowc.c: New file. * mingwex/wctob.c: New file. * mingwex/mb_wc_common.h: New file. * mingwex/Makefile.in (DISTFILES): Add new files. (Q8_OBJS): Add new objects. * include/wchar.h: Adjust comment about mbrtowc() and related funcions. Add __restrict__ to pointer params in prototypes. (wmemset. wmemchr, wmemcpy, wmemmove, wcstoll, wcstoull): Remove arg names from protototypes.
20 lines
364 B
C
Executable File
20 lines
364 B
C
Executable File
#include "mb_wc_common.h"
|
|
#include <wchar.h>
|
|
#include <stdio.h>
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
|
|
wint_t btowc (int c)
|
|
{
|
|
if (c == EOF)
|
|
return (WEOF);
|
|
else
|
|
{
|
|
unsigned char ch = c;
|
|
wchar_t wc = WEOF;
|
|
MultiByteToWideChar (get_cp_from_locale(), MB_ERR_INVALID_CHARS,
|
|
(char*)&ch, 1, &wc, 1);
|
|
return wc;
|
|
}
|
|
}
|