| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Spam-Check-By: | sourceware.org |
| Date: | Wed, 23 Jan 2008 22:43:11 +0100 |
| From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: HDF5 and timezone |
| Message-ID: | <20080123214311.GT30866@calimero.vinschen.de> |
| Reply-To: | cygwin AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| References: | <4796A3BC DOT 3060001 AT niwa DOT co DOT nz> <4797AF61 DOT 7030501 AT niwa DOT co DOT nz> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <4797AF61.7030501@niwa.co.nz> |
| 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 Jan 24 10:19, Mark Hadfield wrote:
> I have worked around the problem with HDF5 and reported the problem to the
> maintainers. I expect they will want to support both 1.5.25 and earlier
> versions. How long has the POSIX-compliant
> form of timezone been available?
The timezone variable has been around since 1997, but it's called
_timezone for historical reasons. Prior to 1.5.25 there was a
# ifndef timezonevar
char *timezone (void);
# elif !defined(timezone)
# define timezone _timezone
# endif
#endif /*__STRICT_ANSI__*/
so you have to `#define timezonevar' to get the timezone variable. The
problem is that this collides potentially with the definition of struct
timezone. 1.5.25 now defines timezone like this:
extern long timezone __asm__ ("__timezone");
In theory (and if the code doesn't use the struct timezone) the below
code should be portable and should work fine with any version of Cygwin:
#ifdef __CYGWIN__
#define timezonevar
#endif
#include <time.h>
[... use timezone variable ...]
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |