aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/datetime.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-10-29 13:17:34 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-10-29 13:17:34 +0000
commit525e1c4436651c39f713416348bd35e3176b7797 (patch)
tree6f1f991d40bc259990be5f581f791882c4aae6af /src/backend/utils/adt/datetime.c
parent8b0431129309e4a4ddbc91f5a3e58631a07ac13c (diff)
downloadpostgresql-525e1c4436651c39f713416348bd35e3176b7797.tar.gz
postgresql-525e1c4436651c39f713416348bd35e3176b7797.zip
USE_POSIX_TIME replaced by HAVE_TM_ZONE || HAVE_INT_TIMEZONE, which are
equivalent. In linux.h there were some #undef HAVE_INT_TIMEZONE, which are useless because HAVE_TM_ZONE overrides it anyway, and messing with configure results isn't cool.
Diffstat (limited to 'src/backend/utils/adt/datetime.c')
-rw-r--r--src/backend/utils/adt/datetime.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 39a39c479d7..a4c1abb9ee3 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.53 2000/09/12 05:41:37 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.54 2000/10/29 13:17:33 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -19,13 +19,8 @@
#include <sys/types.h>
#include <errno.h>
#include <float.h>
-
#include <limits.h>
-#ifndef USE_POSIX_TIME
-#include <sys/timeb.h>
-#endif
-
#include "miscadmin.h"
#include "utils/datetime.h"
@@ -885,7 +880,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
if (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
{
-#ifdef USE_POSIX_TIME
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tm->tm_year -= 1900;
tm->tm_mon -= 1;
tm->tm_isdst = -1;
@@ -893,20 +888,18 @@ DecodeDateTime(char **field, int *ftype, int nf,
tm->tm_year += 1900;
tm->tm_mon += 1;
-#if defined(HAVE_TM_ZONE)
+# if defined(HAVE_TM_ZONE)
*tzp = -(tm->tm_gmtoff); /* tm_gmtoff is
* Sun/DEC-ism */
-#elif defined(HAVE_INT_TIMEZONE)
-#ifdef __CYGWIN__
+# elif defined(HAVE_INT_TIMEZONE)
+# ifdef __CYGWIN__
*tzp = ((tm->tm_isdst > 0) ? (_timezone - 3600) : _timezone);
-#else
+# else
*tzp = ((tm->tm_isdst > 0) ? (timezone - 3600) : timezone);
-#endif
-#else
-#error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined
-#endif
+# endif /* __CYGWIN__ */
+# endif /* HAVE_INT_TIMEZONE */
-#else /* !USE_POSIX_TIME */
+#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
*tzp = CTimeZone;
#endif
}
@@ -1139,24 +1132,22 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
tmp->tm_min = tm->tm_min;
tmp->tm_sec = tm->tm_sec;
-#ifdef USE_POSIX_TIME
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tmp->tm_isdst = -1;
mktime(tmp);
tm->tm_isdst = tmp->tm_isdst;
-#if defined(HAVE_TM_ZONE)
+# if defined(HAVE_TM_ZONE)
*tzp = -(tmp->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */
-#elif defined(HAVE_INT_TIMEZONE)
-#ifdef __CYGWIN__
+# elif defined(HAVE_INT_TIMEZONE)
+# ifdef __CYGWIN__
*tzp = ((tmp->tm_isdst > 0) ? (_timezone - 3600) : _timezone);
-#else
+# else
*tzp = ((tmp->tm_isdst > 0) ? (timezone - 3600) : timezone);
-#endif
-#else
-#error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined
-#endif
+# endif
+# endif
-#else /* !USE_POSIX_TIME */
+#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
*tzp = CTimeZone;
#endif
}