Skip site navigation (1) Skip section navigation (2)

Re: timezone vs _timezone on Windows

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: timezone vs _timezone on Windows
Date: 2004-09-08 19:41:11
Message-ID: 200409081941.i88JfBA14805@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32
I just applied a patch to use _timezone on Cygwin consistenly.

---------------------------------------------------------------------------

Tom Lane wrote:
> I think I see the real issue behind the recent argument about the
> datatype of the timezone variable.  I don't think the datatype matters,
> but the name certainly does.  In pgtz.c we have
> 
> #if defined(HAVE_STRUCT_TM_TM_ZONE)
> 	return tm->tm_gmtoff;
> #elif defined(HAVE_INT_TIMEZONE)
> #ifdef HAVE_UNDERSCORE_TIMEZONE
> 	return -_timezone;
> #else
> 	return -timezone;
> #endif
> #else
> #error No way to determine TZ? Can this happen?
> #endif
> 
> but the symbol HAVE_UNDERSCORE_TIMEZONE appears nowhere else ---
> certainly it's not set by configure, and never has been.  So the
> "_timezone" case is dead code at the moment.
> 
> In 7.4, pg_config_manual.h contained
> 
> /*
>  * Define this if your operating system has _timezone rather than timezone
>  */
> #if defined(__CYGWIN__) || defined(WIN32)
> #define HAVE_INT_TIMEZONE		/* has int _timezone */
> #define HAVE_UNDERSCORE_TIMEZONE 1
> #endif
> 
> but this passage has disappeared from CVS tip.  So given a platform that
> has "_timezone" but not "timezone", CVS tip is broken.
> 
> I am wondering how changing this would affect the existing, allegedly
> working Windows port.  Should we put back the pg_config_manual.h entry?
> Should we restrict it to __CYGWIN__ only?
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers by date

Next:From: David FetterDate: 2004-09-08 19:46:42
Subject: Geometry regression test failure, CVS HEAD, Mac OS/X
Previous:From: Dave PageDate: 2004-09-08 19:32:38
Subject: Re: Contrib modules on Win32

pgsql-hackers-win32 by date

Next:From: Claudio NatoliDate: 2004-09-09 01:14:18
Subject: Re: Contrib modules on Win32
Previous:From: Dave PageDate: 2004-09-08 19:32:38
Subject: Re: Contrib modules on Win32

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group