4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-16 03:19:54 +08:00

20 lines
358 B
C
Raw Normal View History

#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_codepage(), MB_ERR_INVALID_CHARS,
(char*)&ch, 1, &wc, 1);
return wc;
}
}