From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15757 invoked by alias); 13 Feb 2008 23:39:41 -0000 Received: (qmail 15744 invoked by uid 22791); 13 Feb 2008 23:39:40 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Feb 2008 23:39:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9B3132A9CE8; Wed, 13 Feb 2008 18:39:19 -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 JQmyDpWubWVh; Wed, 13 Feb 2008 18:39:19 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 617662A9CE6; Wed, 13 Feb 2008 18:39:19 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id DA5D3E7ACB; Wed, 13 Feb 2008 15:39:16 -0800 (PST) Date: Wed, 13 Feb 2008 23:39:00 -0000 From: Joel Brobecker To: Dave Murphy Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] build powerpc sim for mingw host Message-ID: <20080213233916.GA3713@adacore.com> References: <47ACE034.6020802@devkitpro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47ACE034.6020802@devkitpro.org> User-Agent: Mutt/1.4.2.2i 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: 2008-02/txt/msg00216.txt.bz2 Hi Dave, I'm not a simulator maintainer, so I can't actually approve your patch, but I took a look. > @@ -128,7 +128,7 @@ > file->pos = file->buffer; > > /* read it in */ > -#ifdef __CYGWIN32__ > +#ifdef __WIN32__ > if ((file->size) && ((nr = read(fd, file->buffer, file->size)) <= 0)) { > #else > if ((nr = read(fd, file->buffer, file->size)) < file->size) { I don't think this is right. It looks like you are breaking the simulator on cygwin, or at least changing the behavior, because the cygwin GCC doesn't define __WIN32__ (I just tried it on a windows machine). The current usage in GDB suggests that you want to use: #if defined(_WIN32) || defined (__CYGWIN32__) Question to the Windows specialists: In the GDB sources, we exclusively use the __CYGWIN__ macro, whereas in the simulator sources, we use __CYGWIN32__. The name of the latter macro suggests that this macro is going to be defined only on 32bit processors whereas the code above might be general to all cygwin versions, regardless of the CPU type. Should the above be changed to: #if defined(_WIN32) || defined (__CYGWIN__) ? There is another file (sim/common/dv-sockser.c) where the inclusion of is conditional on __CYGWIN32__. -- Joel