public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: uchar.h: fix definition of uchar16_t and uchar32_t
Date: Wed,  2 Aug 2023 15:04:04 +0000 (GMT)	[thread overview]
Message-ID: <20230802150404.CC2D63858C5E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8fbbc668a01db50c3735d396f6e021940f7b3834

commit 8fbbc668a01db50c3735d396f6e021940f7b3834
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Wed Aug 2 16:50:23 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Aug 2 16:56:24 2023 +0200

    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>

Diff:
---
 winsup/cygwin/include/uchar.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/winsup/cygwin/include/uchar.h b/winsup/cygwin/include/uchar.h
index 84020553700d..bf865ff16e7f 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

                 reply	other threads:[~2023-08-02 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230802150404.CC2D63858C5E@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).