diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-08-02 16:55:52 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-08-02 16:56:24 +0200 |
commit | c49bc478b4a7e7d00a0c8540b8d6b6e99453443e (patch) | |
tree | 94599bcbebcec9ab2570a9bfdcbdfda85aa3dc1a /winsup/cygwin/include | |
parent | 290b56a87947620f171f65190616116fc1e0082c (diff) | |
download | newlib-c49bc478b4a7e7d00a0c8540b8d6b6e99453443e.zip newlib-c49bc478b4a7e7d00a0c8540b8d6b6e99453443e.tar.gz newlib-c49bc478b4a7e7d00a0c8540b8d6b6e99453443e.tar.bz2 |
Cygwin: Add ISO C2X functions c8rtomb, mbrtoc8
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/uchar.h | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 7bc3e5e..833de64 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -482,12 +482,13 @@ details. */ 346: (Belatedly) add posix_spawn_file_actions_addchdir_np, posix_spawn_file_actions_addfchdir_np. 347: Add c16rtomb, c32rtomb, mbrtoc16, mbrtoc32. + 348: Add c8rtomb, mbrtoc. Note that we forgot to bump the api for ualarm, strtoll, strtoull, sigaltstack, sethostname. */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 346 +#define CYGWIN_VERSION_API_MINOR 348 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible changes are made to the shared 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); |