From: Eli Zaretskii <eliz@gnu.org>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] windows-nat: Decode system error numbers
Date: Wed, 09 Nov 2011 16:45:00 -0000 [thread overview]
Message-ID: <83obwlgsc5.fsf@gnu.org> (raw)
In-Reply-To: <alpine.DEB.1.10.1111091050490.5099@tp.orcam.me.uk>
> Date: Wed, 9 Nov 2011 12:02:40 +0000
> From: "Maciej W. Rozycki" <macro@codesourcery.com>
>
> + const char *msg = "Unspecified error.";
> + unsigned long err;
> + char buf[1025];
> + size_t size;
> +
> + if (ok)
> + return;
> +
> + err = GetLastError();
> + size = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM
> + | FORMAT_MESSAGE_IGNORE_INSERTS,
> + NULL,
> + err,
> + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
> + buf, (sizeof (buf) - 1) / sizeof (TCHAR), NULL);
Will this DTRT with Cygwin, which AFAIK wants the wide versions of the
APIs? Is, for example, "char buf[1025];" appropriate in that case?
next prev parent reply other threads:[~2011-11-09 16:45 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 [this message]
2011-11-09 16:58 ` Pedro Alves
2011-11-09 17:03 ` Eli Zaretskii
2011-11-09 17:26 ` Pedro Alves
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=83obwlgsc5.fsf@gnu.org \
--to=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