Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, macro@codesourcery.com
Subject: Re: [PATCH] windows-nat: Decode system error numbers
Date: Wed, 09 Nov 2011 17:26:00 -0000	[thread overview]
Message-ID: <201111091726.00178.pedro@codesourcery.com> (raw)
In-Reply-To: <83k479gri5.fsf@gnu.org>

On Wednesday 09 November 2011 17:00:50, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Wed, 9 Nov 2011 16:58:00 +0000
> > Cc: "Maciej W. Rozycki" <macro@codesourcery.com>
> > 
> > > 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


  reply	other threads:[~2011-11-09 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 12:03 Maciej W. Rozycki
2011-11-09 15:25 ` Joel Brobecker
2011-11-09 16:45 ` Eli Zaretskii
2011-11-09 16:58   ` Pedro Alves
2011-11-09 17:03     ` Eli Zaretskii
2011-11-09 17:26       ` Pedro Alves [this message]
2011-11-09 17:07     ` Corinna Vinschen
2011-11-13 23:47       ` Christopher Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201111091726.00178.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox