X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Eric Blake <ebb9@byu.net>
Subject:  Re: octave configure on cygwin snapshot
Date: Wed, 29 Aug 2007 16:51:26 +0000 (UTC)
Lines: 26
Message-ID:  <loom.20070829T184319-70@post.gmane.org>
References:  <010e01c7ea38$d6cbd820$2e08a8c0@CAM.ARTIMI.COM> <727852.30843.qm@web25003.mail.ukl.yahoo.com> <loom.20070829T182229-247@post.gmane.org>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Eric Blake <ebb9 <at> byu.net> writes:

> As your testcase shows, the inclusion of <sys/time.h> manages to define 
struct 
> timezone, but then subsequent includes trigger the macro that changes the 
> spelling to _timezone, and your declarations all end up referring to the 
> incomplete type struct _timezone, hence the compiler error.  So something in 
> cygwin's headers needs to change in order to make sure struct timezone is not 
> hidden by the macro in <cygwin/time.h>.

At first, I thought the solution might be as simple as having <cygwin/time.h> 
declare struct _timezone which is identical in layout to <time.h>'s struct 
timezone.  But then I realized there is another clash to also fix - if the user 
does:
#include <sys/timeb.h>
#include <sys/time.h>

then how do they refer to struct timeb.timezone?  Maybe the correct fix is a 
cygwin-specific newlib patch to both sys/timeb.h and sys/time.h that moves the 
#include <cygwin/time.h> earlier in the file, so that timezone is redefined to 
_timezone before any other declaration that tries to use the name timezone.

-- 
Eric Blake




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

