From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12628 invoked by alias); 21 Feb 2011 10:22:03 -0000 Received: (qmail 12619 invoked by uid 22791); 21 Feb 2011 10:22:03 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_00,RISK_FREE,TW_SF X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Feb 2011 10:21:59 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id EABBB2BAC4F; Mon, 21 Feb 2011 05:21:57 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TB66rueftSb6; Mon, 21 Feb 2011 05:21:57 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 76ABC2BAC41; Mon, 21 Feb 2011 05:21:57 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id ACC0D1459B0; Mon, 21 Feb 2011 14:21:51 +0400 (RET) Date: Mon, 21 Feb 2011 11:06:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFA] mingw port: Allow use of cvs GDB on Windows 95 Message-ID: <20110221102151.GG2600@adacore.com> References: <001201cbc46c$5b95b100$12c11300$@muller@ics-cnrs.unistra.fr> <000001cbc473$6ef9d120$4ced7360$@muller@ics-cnrs.unistra.fr> <002401cbc574$a8d990e0$fa8cb2a0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002401cbc574$a8d990e0$fa8cb2a0$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-06-14) 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-02/txt/msg00535.txt.bz2 > 2011-02-05 Pierre Muller > > Allow use of mingw native on Windows 95 OS. > * src/gdb/ser-mingw.c (CancelIo): New macro for dynamically loaded > DLL entry. > (ser_windows_close): Only call CancelIo if function exists. > (_initialize_ser_windows): Use LoadLirary/GetProcAddress > to check for existence of CancelIo function in kernel32 DLL. I was hoping that someone with more Windows knowledge would be able to review this patch, but oh well... This patch looks OK to me (ie, no risk that I can see for the other platforms). Just a couple of remarks: > +/* CancelIo is not available for Windows 95 OS, > + so we need to use LoadLibrary/GetProcAddress to avoid > + a startup failure. */ I find that the length of your lines are consistently really short and inconsistent. I think it makes it harder to read. The above can be reformatted to: /* CancelIo is not available for Windows 95 OS, so we need to use LoadLibrary/GetProcAddress to avoid a startup failure. */ (but I think you could also look at your editor to see if there is anything that's contributing to this, especially the inconsistency - are you using fixed fonts?) > +#define CancelIo dyn_CancelIo > + > +static BOOL WINAPI (*CancelIo) (HANDLE); I would *personally* keep these two together, to make it clearer that the comment above applies to both. Just a thought, so don't feel obligated to follow the suggestion if you don't agree. > /* Stop any pending selects. */ > - CancelIo ((HANDLE) _get_osfhandle (scb->fd)); > + if (CancelIo) > + CancelIo ((HANDLE) _get_osfhandle (scb->fd)); Can you add a comment explaining why it's OK to not call CancelIo if it is not defined? I think you were trying to get more info about this on this list - whatever information that you might have gleaned... The patch is pre-approved once the comments are addressed. -- Joel