From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30624 invoked by alias); 3 Mar 2010 21:15:57 -0000 Received: (qmail 30614 invoked by uid 22791); 3 Mar 2010 21:15:57 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS 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; Wed, 03 Mar 2010 21:15:53 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o23LFqrw011271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Mar 2010 16:15:52 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o23LFpNm004445; Wed, 3 Mar 2010 16:15:51 -0500 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 o23LFonw022898; Wed, 3 Mar 2010 16:15:50 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 082BC379963; Wed, 3 Mar 2010 14:15:50 -0700 (MST) From: Tom Tromey To: gdb-patches@sourceware.org Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds References: <20100228184749.GA17375@caradoc.them.org> <20100228192159.GP5683@calimero.vinschen.de> <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> Reply-To: tromey@redhat.com Date: Wed, 03 Mar 2010 21:15:00 -0000 In-Reply-To: <20100303101601.GH17293@calimero.vinschen.de> (Corinna Vinschen's message of "Wed, 3 Mar 2010 11:16:01 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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: 2010-03/txt/msg00127.txt.bz2 >>>>> "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