From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id CC2D63858C5E; Wed, 2 Aug 2023 15:04:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC2D63858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690988644; bh=vJxGH7jRsF9tZkEqY3RPtHTuBChcbwcTnHhDQ83/2E0=; h=From:To:Subject:Date:From; b=vxCGlvMtHo7CBbd3GzmBl+Je4pTdlifThho0l72WyRdaIk4RXQ6dCCsRYHMGAmMK6 Lbk4HghtveTdnVG+NlvsfK+YAUiolxtxqxsFo/oNsReS4dZkJ+k6IF4RHxF254Xu6m mWECNROEmWPhF1vAva5DDgnj15kIa0nVO64nCbBI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: uchar.h: fix definition of uchar16_t and uchar32_t X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 5ac83ea47a7acd704c2fb0dff1edb7f51f081e52 X-Git-Newrev: 8fbbc668a01db50c3735d396f6e021940f7b3834 Message-Id: <20230802150404.CC2D63858C5E@sourceware.org> Date: Wed, 2 Aug 2023 15:04:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D8fbbc668a01= db50c3735d396f6e021940f7b3834 commit 8fbbc668a01db50c3735d396f6e021940f7b3834 Author: Corinna Vinschen AuthorDate: Wed Aug 2 16:50:23 2023 +0200 Commit: Corinna Vinschen CommitDate: Wed Aug 2 16:56:24 2023 +0200 Cygwin: uchar.h: fix definition of uchar16_t and uchar32_t =20 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. =20 Fixes: 4f258c55e87f ("Cygwin: Add ISO C11 functions c16rtomb, c32rtomb,= mbrtoc16, mbrtoc32.") Signed-off-by: Corinna Vinschen 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 @@ =20 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 =20 __BEGIN_DECLS