Commit e97c8170 authored by Bruce Momjian's avatar Bruce Momjian

Use _timezone global on Cygwin instead of timezone.

parent cef30c65
# Macros that test various C library quirks # Macros that test various C library quirks
# $PostgreSQL: pgsql/config/c-library.m4,v 1.26 2004/06/07 22:39:44 momjian Exp $ # $PostgreSQL: pgsql/config/c-library.m4,v 1.27 2004/09/08 19:43:00 momjian Exp $
# PGAC_VAR_INT_TIMEZONE # PGAC_VAR_INT_TIMEZONE
...@@ -10,7 +10,11 @@ AC_DEFUN([PGAC_VAR_INT_TIMEZONE], ...@@ -10,7 +10,11 @@ AC_DEFUN([PGAC_VAR_INT_TIMEZONE],
[AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone, [AC_CACHE_CHECK(for int timezone, pgac_cv_var_int_timezone,
[AC_TRY_LINK([#include <time.h> [AC_TRY_LINK([#include <time.h>
int res;], int res;],
[res = timezone / 60;], [#ifndef __CYGWIN__
res = timezone / 60;
#else
res = _timezone / 60;
#endif],
[pgac_cv_var_int_timezone=yes], [pgac_cv_var_int_timezone=yes],
[pgac_cv_var_int_timezone=no])]) [pgac_cv_var_int_timezone=no])])
if test x"$pgac_cv_var_int_timezone" = xyes ; then if test x"$pgac_cv_var_int_timezone" = xyes ; then
......
...@@ -10725,7 +10725,11 @@ int res; ...@@ -10725,7 +10725,11 @@ int res;
int int
main () main ()
{ {
#ifndef __CYGWIN__
res = timezone / 60; res = timezone / 60;
#else
res = _timezone / 60;
#endif
; ;
return 0; return 0;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/port.h,v 1.57 2004/08/29 21:08:48 tgl Exp $ * $PostgreSQL: pgsql/src/include/port.h,v 1.58 2004/09/08 19:43:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -180,6 +180,14 @@ extern int win32_open(const char *, int,...); ...@@ -180,6 +180,14 @@ extern int win32_open(const char *, int,...);
#define pclose(a) _pclose(a) #define pclose(a) _pclose(a)
#endif #endif
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endif
extern int copydir(char *fromdir, char *todir); extern int copydir(char *fromdir, char *todir);
/* Missing rand functions */ /* Missing rand functions */
......
...@@ -216,14 +216,6 @@ do { \ ...@@ -216,14 +216,6 @@ do { \
} while(0) } while(0)
#endif #endif
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endif
/* /*
* Date/time validation * Date/time validation
* Include check for leap year. * Include check for leap year.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.27 2004/09/02 01:15:06 momjian Exp $ * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.28 2004/09/08 19:43:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -96,11 +96,7 @@ get_timezone_offset(struct tm * tm) ...@@ -96,11 +96,7 @@ get_timezone_offset(struct tm * tm)
#if defined(HAVE_STRUCT_TM_TM_ZONE) #if defined(HAVE_STRUCT_TM_TM_ZONE)
return tm->tm_gmtoff; return tm->tm_gmtoff;
#elif defined(HAVE_INT_TIMEZONE) #elif defined(HAVE_INT_TIMEZONE)
#ifdef HAVE_UNDERSCORE_TIMEZONE return -TIMEZONE_GLOBAL;
return -_timezone;
#else
return -timezone;
#endif
#else #else
#error No way to determine TZ? Can this happen? #error No way to determine TZ? Can this happen?
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment