From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20413 invoked by alias); 19 Apr 2011 13:19:53 -0000 Received: (qmail 20403 invoked by uid 22791); 19 Apr 2011 13:19:53 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 13:19:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3JDJSP9023582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Apr 2011 09:19:28 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3JDJRp5009869; Tue, 19 Apr 2011 09:19:28 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p3JDJQAE022670; Tue, 19 Apr 2011 09:19:27 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id B848637930B; Tue, 19 Apr 2011 07:19:26 -0600 (MDT) From: Tom Tromey To: "Pierre Muller" Cc: Subject: Re: [RFC-v4] Handle cygwin wchar_t specifics References: <5928.31498147479$1302882967@news.gmane.org> <005101cbfc50$193136b0$4b93a410$%muller@ics-cnrs.unistra.fr> <20110416162455.GA5599@host1.jankratochvil.net> <000001cbfc7d$3f67f440$be37dcc0$%muller@ics-cnrs.unistra.fr> <83zknpoacd.fsf@gnu.org> <21014.6501930014$1303139687@news.gmane.org> <34716.7311156683$1303204711@news.gmane.org> Date: Tue, 19 Apr 2011 13:19:00 -0000 In-Reply-To: <34716.7311156683$1303204711@news.gmane.org> (Pierre Muller's message of "Tue, 19 Apr 2011 11:17:59 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00317.txt.bz2 >>>>> "Pierre" == Pierre Muller writes: Pierre> 1) we should really use "gdb_wchar_t" type, not "wchar_t" Yeah. Pierre> 2) If sizeof(gdb_wchar_t) == 1 Pierre> I don't think that UTF-8LE and UTF-8BE exist, do they? Pierre> At least they are not in the iconv -l list for current cygwin. A platform where this is true should not define __STDC_ISO_10646__. You might as well just assert that the size is 2 or 4. Pierre> 3) WORD_BIGENDIAN is not defined at all on Cygwin, Pierre> so that your code would probably not compile. Yeah, I forgot, you need #if. See config.in. Pierre> A further question is whether UTF-32 is always supported... If someone can find a platform where wchar_t is 4 bytes, where __STDC_ISO_10646__ is defined, and where UTF-32 is not understood, then we can complain bitterly and change the code again. Pierre> Below is yet another proposal: Pierre> it transforms INTERMEDIATE_ENCODING macro into a call to Pierre> intermediate_encoding function. I'd prefer it if the new code is only used in the __STDC_ISO_10646__ case. Pierre> +#ifdef WORDS_BIGENDIAN #if Pierre> +const char * Pierre> +intermediate_encoding (void) New functions require an introductory comment. Pierre> #ifdef PHONY_ICONV Pierre> -#define INTERMEDIATE_ENCODING "wchar_t" Pierre> +#define DEFAULT_INTERMEDIATE_ENCODING "wchar_t" I don't think DEFAULT_INTERMEDIATE_ENCODING is needed. Tom