This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Add uchar.h
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin-patches at cygwin dot com
- Date: Fri, 03 Apr 2009 14:18:58 +0100
- Subject: [PATCH] Add uchar.h
Dave Korn wrote:
>
> I've got a bit of a load on right now what with gcc back in stage1.
However, as part of dealing with that I did try throwing together one of
these. I wrote this from scratch based solely on reading n1040; it's
skeletal, but at least provides the two new unicode typedefs. Want it?
winsup/cygwin/ChangeLog
* include/uchar.h: New file.
cheers,
DaveK
Index: winsup/cygwin/include/uchar.h
===================================================================
RCS file: winsup/cygwin/include/uchar.h
diff -N winsup/cygwin/include/uchar.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ winsup/cygwin/include/uchar.h 3 Apr 2009 13:03:52 -0000
@@ -0,0 +1,37 @@
+/* uchar.h - unicode character types
+
+ Copyright 2009 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _UCHAR_H
+#define _UCHAR_H
+
+/* Exact-width character types */
+
+typedef unsigned short char16_t; /* Must match uint_least16_t */
+typedef unsigned long char32_t; /* Must match uint_least32_t */
+
+
+/* We do not define an encoding yet. */
+
+/* #undef __STDC_UTF_16__ */
+/* #undef __STDC_UTF_32__ */
+
+/* We do not provide the standard library functions yet. */
+
+/* size_t mbrtoc16(char16_t * restrict pc16, const char * restrict s,
+ size_t n, mbstate_t * restrict ps); */
+
+/* size_t c16rtomb(char * restrict s, char16_t c16, mbstate_t * restrict ps); */
+
+/* size_t mbrtoc32(char32_t * restrict pc32, const char * restrict s, size_t n,
+ mbstate_t * restrict ps); */
+
+/* size_t c32rtomb(char * restrict s, char32_t c32, mbstate_t * restrict ps); */
+
+#endif /* _UCHAR_H */