From: "Hans-Bernhard Bröker" <HBBroeker@t-online.de>
To: cygwin@cygwin.com
Subject: [PATCH] Properly encapsulate multi-statement macro.
Date: Thu, 27 Feb 2020 19:47:00 -0000 [thread overview]
Message-ID: <7de8b3a1-d724-c451-979c-9067c8f78710@t-online.de> (raw)
In-Reply-To: <6e96e314-0a4c-d3fa-83e3-902fb85d86c9@t-online.de>
winsup/cygwin/fhandler_console.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_console.cc
b/winsup/cygwin/fhandler_console.cc
index 4ab9bcab8..353abd197 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -63,10 +63,11 @@ static struct fhandler_base::rabuf_t con_ra;
static unsigned char wpbuf[WPBUF_LEN];
static int wpixput;
static unsigned char last_char;
-#define wpbuf_put(x) \
+#define wpbuf_put(x) do { \
wpbuf[wpixput++] = x; \
if (wpixput > WPBUF_LEN) \
- wpixput--;
+ wpixput--; \
+} while(0)
static void
beep ()
--
2.21.0
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next parent reply other threads:[~2020-02-27 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6e96e314-0a4c-d3fa-83e3-902fb85d86c9@t-online.de>
2020-02-27 19:47 ` Hans-Bernhard Bröker [this message]
2020-02-27 22:22 ` Brian Inglis
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=7de8b3a1-d724-c451-979c-9067c8f78710@t-online.de \
--to=hbbroeker@t-online.de \
--cc=cygwin@cygwin.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).