From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 940 invoked by alias); 4 Mar 2010 15:24:42 -0000 Received: (qmail 931 invoked by uid 22791); 4 Mar 2010 15:24:41 -0000 X-Spam-Check-By: sourceware.org Received: from pool-98-110-186-187.bstnma.fios.verizon.net (HELO cgf.cx) (98.110.186.187) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Thu, 04 Mar 2010 15:24:37 +0000 Received: from ednor.cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id CCB4813C0C9 for ; Thu, 4 Mar 2010 10:24:35 -0500 (EST) Received: by ednor.cgf.cx (Postfix, from userid 201) id C976A2B352; Thu, 4 Mar 2010 10:24:35 -0500 (EST) Date: Thu, 04 Mar 2010 15:24:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds Message-ID: <20100304152435.GA12362@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org References: <20100301103125.GB9730@calimero.vinschen.de> <20100301173054.GD5683@calimero.vinschen.de> <20100301193126.GA9416@caradoc.them.org> <20100303101601.GH17293@calimero.vinschen.de> <20100304093406.GX17293@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100304093406.GX17293@calimero.vinschen.de> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-03/txt/msg00179.txt.bz2 On Thu, Mar 04, 2010 at 10:34:06AM +0100, Corinna Vinschen wrote: >On Mar 3 14:15, Tom Tromey wrote: >> >>>>> "Corinna" == Corinna Vinschen writes: >> >> Corinna> Maybe something along these lines would help (untested!): >> >> I'm adding the appended to my local patch. >> This is just your patch with the new global put closer to the code, and >> a different preprocessor check. >> >> Let me know if this seems wrong somehow. >> >> Tom >> >> diff --git a/gdb/charset.c b/gdb/charset.c >> index 21c4306..9c1e7f4 100644 >> --- a/gdb/charset.c >> +++ b/gdb/charset.c >> @@ -930,6 +930,15 @@ _initialize_charset (void) >> if (!strcmp (auto_host_charset_name, "646") || !*auto_host_charset_name) >> auto_host_charset_name = "ASCII"; >> auto_target_charset_name = auto_host_charset_name; >> +#elif defined (USE_WIN32API) >> + { >> + static w32_host_default_charset[16]; /* "CP" + x<=5 digits + paranoia. */ >> + >> + snprintf (w32_host_default_charset, sizeof w32_host_default_charset, >> + "CP%d", GetACP()); >> + auto_host_charset_name = w32_host_default_charset; >> + auto_target_charset_name = auto_host_charset_name; >> + } >> #endif >> #endif > >Looks good to me. I don't know if I get to approve this but if it looks ok to Corinna, it's ok with me. I'm not too wide character set literate. cgf