From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10977 invoked by alias); 4 Mar 2010 09:34:14 -0000 Received: (qmail 10964 invoked by uid 22791); 4 Mar 2010 09:34:14 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Thu, 04 Mar 2010 09:34:08 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 21C7C6D42F5; Thu, 4 Mar 2010 10:34:06 +0100 (CET) Date: Thu, 04 Mar 2010 09:34:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds Message-ID: <20100304093406.GX17293@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org References: <20100228222702.GC29360@caradoc.them.org> <20100301103125.GB9730@calimero.vinschen.de> <20100301173054.GD5683@calimero.vinschen.de> <20100301193126.GA9416@caradoc.them.org> <20100303101601.GH17293@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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/msg00167.txt.bz2 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. Thank you, Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat