diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-08-02 16:50:23 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-08-02 16:56:24 +0200 |
commit | 8fbbc668a01db50c3735d396f6e021940f7b3834 (patch) | |
tree | afdfe11ac9af2ff783512553730310f8018846fd /winsup | |
parent | 5ac83ea47a7acd704c2fb0dff1edb7f51f081e52 (diff) | |
download | newlib-8fbbc668a01db50c3735d396f6e021940f7b3834.zip newlib-8fbbc668a01db50c3735d396f6e021940f7b3834.tar.gz newlib-8fbbc668a01db50c3735d396f6e021940f7b3834.tar.bz2 |
Cygwin: uchar.h: fix definition of uchar16_t and uchar32_t
Per C++11, uchar16_t and uchar32_t are defined the same as
uint_least16_t and uint_least32_t. Also, check for the C++
version to make sure that the types are not colliding with
predefined c++ types.
Fixes: 4f258c55e87f ("Cygwin: Add ISO C11 functions c16rtomb, c32rtomb, mbrtoc16, mbrtoc32.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/include/uchar.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/include/uchar.h b/winsup/cygwin/include/uchar.h index 8402055..bf865ff 100644 --- a/winsup/cygwin/include/uchar.h +++ b/winsup/cygwin/include/uchar.h @@ -6,6 +6,11 @@ typedef __uint16_t char16_t; typedef __uint32_t char32_t; +/* C++11 already defines those types. */ +#if !defined (__cplusplus) || (__cplusplus - 0 < 201103L) +typedef __uint_least16_t char16_t; +typedef __uint_least32_t char32_t; +#endif __BEGIN_DECLS |