diff options
Diffstat (limited to 'wcsmbs/uchar.h')
-rw-r--r-- | wcsmbs/uchar.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h index 051cdcbeb5..c37e8619a0 100644 --- a/wcsmbs/uchar.h +++ b/wcsmbs/uchar.h @@ -31,6 +31,13 @@ #include <bits/types.h> #include <bits/types/mbstate_t.h> +/* Declare the C2x char8_t typedef in C2x modes, but only if the C++ + __cpp_char8_t feature test macro is not defined. */ +#if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t +/* Define the 8-bit character type. */ +typedef unsigned char char8_t; +#endif + #ifndef __USE_ISOCXX11 /* Define the 16-bit and 32-bit character types. */ typedef __uint_least16_t char16_t; @@ -40,6 +47,20 @@ typedef __uint_least32_t char32_t; __BEGIN_DECLS +/* Declare the C2x mbrtoc8() and c8rtomb() functions in C2x modes or if + the C++ __cpp_char8_t feature test macro is defined. */ +#if __GLIBC_USE (ISOC2X) || defined __cpp_char8_t +/* Write char8_t representation of multibyte character pointed + to by S to PC8. */ +extern size_t mbrtoc8 (char8_t *__restrict __pc8, + const char *__restrict __s, size_t __n, + mbstate_t *__restrict __p) __THROW; + +/* Write multibyte representation of char8_t C8 to S. */ +extern size_t c8rtomb (char *__restrict __s, char8_t __c8, + mbstate_t *__restrict __ps) __THROW; +#endif + /* Write char16_t representation of multibyte character pointed to by S to PC16. */ extern size_t mbrtoc16 (char16_t *__restrict __pc16, |