]> granicus.if.org Git - postgresql/commitdiff
Make TZNAME_GLOBAL for reference to tzname global variable.
authorBruce Momjian <bruce@momjian.us>
Thu, 9 Sep 2004 00:24:12 +0000 (00:24 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 9 Sep 2004 00:24:12 +0000 (00:24 +0000)
src/include/port.h
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/timestamp.c

index 080026e1c89d7faa321df216421d3f8a6b904433..5c554ccf3a4e789dbc50eb4e1c392b5b942ae480 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/port.h,v 1.58 2004/09/08 19:43:07 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.59 2004/09/09 00:24:10 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -183,9 +183,10 @@ extern int win32_open(const char *, int,...);
 /* Global variable holding time zone information. */
 #if !defined(__CYGWIN__)
 #define TIMEZONE_GLOBAL timezone
+#define TZNAME_GLOBAL tzname
 #else
 #define TIMEZONE_GLOBAL _timezone
-#define tzname _tzname                 /* should be in time.h? */
+#define TZNAME_GLOBAL _tzname
 #endif
 
 extern int     copydir(char *fromdir, char *todir);
index f906b449b08d95c2daacf3f8dcd5333226a0404f..ad9c8b05c30b37f228f09baf334e159d8379bb56 100644 (file)
@@ -1065,8 +1065,8 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char **tzn)
                         * case it contains an error message, which doesn't fit in the
                         * buffer
                         */
-                       StrNCpy(*tzn, tzname[tm->tm_isdst], MAXTZLEN + 1);
-                       if (strlen(tzname[tm->tm_isdst]) > MAXTZLEN)
+                       StrNCpy(*tzn, TZNAME_GLOBAL[tm->tm_isdst], MAXTZLEN + 1);
+                       if (strlen(TZNAME_GLOBAL[tm->tm_isdst]) > MAXTZLEN)
                                tm->tm_isdst = -1;
                }
        }
index fc1681703967fefb8232860b2b0ebdfc854bd2e7..9f4bf782cd008009e1f375347ca2531f97c75eb9 100644 (file)
@@ -223,7 +223,7 @@ timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
 #elif defined(HAVE_INT_TIMEZONE)
                        *tzp = ((tm->tm_isdst > 0) ? (TIMEZONE_GLOBAL - 3600) : TIMEZONE_GLOBAL);
                        if (tzn != NULL)
-                               *tzn = tzname[(tm->tm_isdst > 0)];
+                               *tzn = TZNAME_GLOBAL[(tm->tm_isdst > 0)];
 #endif
 
 #else                                                  /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */