Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite97c817

Browse files
committed
Use _timezone global on Cygwin instead of timezone.
1 parentcef30c6 commite97c817

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

‎config/c-library.m4

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Macros that test various C library quirks
2-
# $PostgreSQL: pgsql/config/c-library.m4,v 1.26 2004/06/07 22:39:44 momjian Exp $
2+
# $PostgreSQL: pgsql/config/c-library.m4,v 1.27 2004/09/08 19:43:00 momjian Exp $
33

44

55
# PGAC_VAR_INT_TIMEZONE
@@ -10,7 +10,11 @@ AC_DEFUN([PGAC_VAR_INT_TIMEZONE],
1010
[AC_CACHE_CHECK(forinttimezone,pgac_cv_var_int_timezone,
1111
[AC_TRY_LINK([#include <time.h>
1212
int res;],
13-
[res = timezone / 60;],
13+
[#ifndef __CYGWIN__
14+
res = timezone / 60;
15+
#else
16+
res = _timezone / 60;
17+
#endif],
1418
[pgac_cv_var_int_timezone=yes],
1519
[pgac_cv_var_int_timezone=no])])
1620
if test x"$pgac_cv_var_int_timezone" = xyes ; then

‎configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10725,7 +10725,11 @@ int res;
1072510725
int
1072610726
main ()
1072710727
{
10728+
#ifndef __CYGWIN__
1072810729
res = timezone / 60;
10730+
#else
10731+
res = _timezone / 60;
10732+
#endif
1072910733
;
1073010734
return 0;
1073110735
}

‎src/include/port.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.57 2004/08/29 21:08:48 tgl Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.58 2004/09/08 19:43:07 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -180,6 +180,14 @@ extern intwin32_open(const char *, int,...);
180180
#definepclose(a) _pclose(a)
181181
#endif
182182

183+
/* Global variable holding time zone information. */
184+
#if !defined(__CYGWIN__)
185+
#defineTIMEZONE_GLOBAL timezone
186+
#else
187+
#defineTIMEZONE_GLOBAL _timezone
188+
#definetzname _tzname/* should be in time.h? */
189+
#endif
190+
183191
externintcopydir(char*fromdir,char*todir);
184192

185193
/* Missing rand functions */

‎src/interfaces/ecpg/pgtypeslib/dt.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,6 @@ do { \
216216
} while(0)
217217
#endif
218218

219-
/* Global variable holding time zone information. */
220-
#if !defined(__CYGWIN__)&& !defined(WIN32)
221-
#defineTIMEZONE_GLOBAL timezone
222-
#else
223-
#defineTIMEZONE_GLOBAL _timezone
224-
#definetzname _tzname/* should be in time.h? */
225-
#endif
226-
227219
/*
228220
* Date/time validation
229221
* Include check for leap year.

‎src/timezone/pgtz.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.27 2004/09/02 01:15:06 momjian Exp $
9+
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.28 2004/09/08 19:43:12 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -96,11 +96,7 @@ get_timezone_offset(struct tm * tm)
9696
#if defined(HAVE_STRUCT_TM_TM_ZONE)
9797
returntm->tm_gmtoff;
9898
#elif defined(HAVE_INT_TIMEZONE)
99-
#ifdefHAVE_UNDERSCORE_TIMEZONE
100-
return-_timezone;
101-
#else
102-
return-timezone;
103-
#endif
99+
return-TIMEZONE_GLOBAL;
104100
#else
105101
#error No way to determine TZ? Can this happen?
106102
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp