aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/include/uchar.h
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/include/uchar.h')
-rw-r--r--winsup/cygwin/include/uchar.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/include/uchar.h b/winsup/cygwin/include/uchar.h
index bf865ff..ed548ac 100644
--- a/winsup/cygwin/include/uchar.h
+++ b/winsup/cygwin/include/uchar.h
@@ -4,8 +4,11 @@
#include <sys/cdefs.h>
#include <wchar.h>
-typedef __uint16_t char16_t;
-typedef __uint32_t char32_t;
+/* Either C2x or if C++ doesn't already define char8_t */
+#if __ISO_C_VISIBLE >= 2020 && !defined (__cpp_char8_t)
+typedef unsigned char char8_t;
+#endif
+
/* C++11 already defines those types. */
#if !defined (__cplusplus) || (__cplusplus - 0 < 201103L)
typedef __uint_least16_t char16_t;
@@ -14,6 +17,13 @@ typedef __uint_least32_t char32_t;
__BEGIN_DECLS
+/* Either C2x or if C++ defines char8_t */
+#if __ISO_C_VISIBLE >= 2020 || defined (__cpp_char8_t)
+size_t c8rtomb(char * __restrict, char8_t, mbstate_t * __restrict);
+size_t mbrtoc8(char8_t * __restrict, const char * __restrict, size_t,
+ mbstate_t * __restrict);
+#endif
+
size_t c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict);
size_t mbrtoc16(char16_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict);