Welcome to mirror list, hosted at ThFree Co, Russian Federation.

btowc.c « mingwex « mingw « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b369190d7e1d9a84b8858a85ae7cda925f145a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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;
    }
}