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

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2005-04-24 15:30:27 +0400
committerDanny Smith <dannysmith@users.sourceforge.net>2005-04-24 15:30:27 +0400
commit6fbeb6a3f07e9c5c62966e8bf2a4ecfd367f23a9 (patch)
treeed637eb4a0126508546e5c4100176eb1123ec931 /winsup/mingw/mingwex/btowc.c
parent4fc953d6a1448be843847bfbd29e022d78134eee (diff)
* mingwex/mbrtowc.c: New file.
* 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.
Diffstat (limited to 'winsup/mingw/mingwex/btowc.c')
-rwxr-xr-xwinsup/mingw/mingwex/btowc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/btowc.c b/winsup/mingw/mingwex/btowc.c
new file mode 100755
index 000000000..b369190d7
--- /dev/null
+++ b/winsup/mingw/mingwex/btowc.c
@@ -0,0 +1,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;
+ }
+}