From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20853 invoked by alias); 9 Nov 2011 17:26:38 -0000 Received: (qmail 20832 invoked by uid 22791); 9 Nov 2011 17:26:37 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Nov 2011 17:26:04 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ROBuV-0004RI-V4 from pedro_alves@mentor.com ; Wed, 09 Nov 2011 09:26:04 -0800 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Nov 2011 17:26:01 +0000 From: Pedro Alves To: Eli Zaretskii Subject: Re: [PATCH] windows-nat: Decode system error numbers Date: Wed, 09 Nov 2011 17:26:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-12-generic; KDE/4.7.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, macro@codesourcery.com References: <201111091658.00913.pedro@codesourcery.com> <83k479gri5.fsf@gnu.org> In-Reply-To: <83k479gri5.fsf@gnu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111091726.00178.pedro@codesourcery.com> 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: 2011-11/txt/msg00239.txt.bz2 On Wednesday 09 November 2011 17:00:50, Eli Zaretskii wrote: > > From: Pedro Alves > > Date: Wed, 9 Nov 2011 16:58:00 +0000 > > Cc: "Maciej W. Rozycki" > > > > > Will this DTRT with Cygwin, which AFAIK wants the wide versions of the > > > APIs? Is, for example, "char buf[1025];" appropriate in that case? > > > > Yeah, if UNICODE is defined, FormatMessage maps to FormatMessageW and > > buf will be filled with a wide string, though I'm not sure > > if __USEWIDE implies UNICODE. > > But buf[] should be TCHAR then, shouldn't it? Right, and that's what strwinerror does. But looking at the windows-nat.c code, indeed __USEWISE does not seem to imply UNICODE. Otherwise e.g., this HANDLE hconsole = CreateFile ("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); wouldn't compile on cygwin. So I don't think we support building windows-nat.c with UNICODE on currently (gdbserver/win32-low.c does build that way though, since it builds on Windows CE too, and that is always UNICODE), and char would be fine. -- Pedro Alves