delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/12/01/07:01:15

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 1 Dec 2007 13:00:32 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Failure in building GFortran on Cygwin
Message-ID: <20071201120032.GB30894@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT CYG DOT 4 DOT 58 DOT 0711292328360 DOT 1532 AT homepc> <474F61CD DOT 1060405 AT verizon DOT net> <20071130142008 DOT GX30894 AT calimero DOT vinschen DOT de> <47501D95 DOT 3030200 AT byu DOT net> <20071130145842 DOT GY30894 AT calimero DOT vinschen DOT de> <20071130213601 DOT GC24092 AT ednor DOT casa DOT cgf DOT cx> <20071201103155 DOT GZ30894 AT calimero DOT vinschen DOT de> <4751420F DOT F35239F3 AT dessent DOT net>
MIME-Version: 1.0
In-Reply-To: <4751420F.F35239F3@dessent.net>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Dec  1 03:14, Brian Dessent wrote:
> Corinna Vinschen wrote:
> 
> > Unfortunately it doesn't work for variables.  We can hide the timezone
> > function, but how do we alias timezone to _timezone in libcygwin.a?
> 
> Why does the variable need to be renamed?  Can't we continue to call it
> _timezone internally and then "#define timezone _timezone" in a public
> header?  It looks like this is already what we get in <cygwin/time.h> if
> we simply stop defining __timezonefunc__.

That's the default case starting with 1.5.25.  You get timezone
by this #define in cygwin/time.h.

The problem right now is that this clashes with the previous definition
of `struct timezone'.  What happens is this:

  struct timezone { int foo; };    // by including sys/time.h
  [...]
  #define timezone _timezone       // sys/time.h includes cygwin/time.h
  [...]
  struct timezone tzp;             // the application defines this tzp var

So `struct timezone tzp' becomes `struct _timezone tzp' which is
an unknown structure type.

I have a simple patch for this which just reorders sys/time.h slightly.
The effect is that the #define is pulled in front of the structure
definition so all timezone gets _timezone and that's it.

> Or is pulluting the namespace with a macro called "timezone" too
> hideous?  In that case we could try declaring it "extern long timezone
> asm("_timezone");" in the header.

Erm... sorry if my lack of assembler inlining shows, but that really
works?  If so, it looks like a rather elegant solution to me.  I'll give
it a try.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019