From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104510 invoked by alias); 27 Feb 2020 22:22:57 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 104503 invoked by uid 89); 27 Feb 2020 22:22:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=Reader, HContent-Transfer-Encoding:8bit X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Feb 2020 22:22:56 +0000 Received: from [192.168.1.114] ([24.64.172.44]) by shaw.ca with ESMTP id 7RYTjBkU517ZD7RYUjWZ7D; Thu, 27 Feb 2020 15:22:54 -0700 Reply-To: cygwin@cygwin.com Subject: Re: [PATCH] Properly encapsulate multi-statement macro. To: cygwin@cygwin.com References: <6e96e314-0a4c-d3fa-83e3-902fb85d86c9@t-online.de> <7de8b3a1-d724-c451-979c-9067c8f78710@t-online.de> From: Brian Inglis Message-ID: Date: Thu, 27 Feb 2020 22:22:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <7de8b3a1-d724-c451-979c-9067c8f78710@t-online.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00259.txt.bz2 On 2020-02-27 12:47, Hans-Bernhard Bröker wrote: > >  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 { \ Please split to avoid eye bleed: +#define wpbuf_put(x) \ +do { \ >    wpbuf[wpixput++] = x; \ >    if (wpixput > WPBUF_LEN) \ > -    wpixput--; > +    wpixput--; \ > +} while(0) > >  static void >  beep () and post to cygwin-patches? -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. -- 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