This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: octave configure on cygwin snapshot

Eric Blake <ebb9 <at>> writes:

> As your testcase shows, the inclusion of <sys/time.h> manages to define 
> 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 
#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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]