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.
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.50 2000/09/12 05:41:37 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.51 2000/10/29 13:17:33 petere Exp $
*
*-------------------------------------------------------------------------
*/
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_hour = 0;
tm->tm_min = 0;
tm->tm_sec = 0;
elog(ERROR, "Unable to convert date to tm");
result = utime + ((date2j(1970,1,1)-date2j(2000,1,1))*86400.0);
-#else /* !USE_POSIX_TIME */
+#else
result = dateVal*86400.0+CTimeZone;
#endif
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#include
#include
#include
-
#include
-#ifndef USE_POSIX_TIME
-#include
-#endif
-
#include "miscadmin.h"
#include "utils/datetime.h"
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;
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
}
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
}
/* -----------------------------------------------------------------------
* formatting.c
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.22 2000/09/25 12:58:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.23 2000/10/29 13:17:34 petere Exp $
*
*
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
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_isdst = -1;
tm->tm_year -= 1900;
tm->tm_mon -= 1;
-#ifdef DEBUG_TO_FROM_CHAR
+# ifdef DEBUG_TO_FROM_CHAR
elog(DEBUG_elog_output, "TO-FROM_CHAR: Call mktime()");
NOTICE_TM;
-#endif
+# endif
mktime(tm);
tm->tm_year += 1900;
tm->tm_mon += 1;
-#if defined(HAVE_TM_ZONE)
+# if defined(HAVE_TM_ZONE)
tz = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */
-#elif defined(HAVE_INT_TIMEZONE)
+# elif defined(HAVE_INT_TIMEZONE)
-#ifdef __CYGWIN__
+# ifdef __CYGWIN__
tz = (tm->tm_isdst ? (_timezone - 3600) : _timezone);
-#else
+# else
tz = (tm->tm_isdst ? (timezone - 3600) : timezone);
-#endif
+# endif
-#else
-#error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined
-#endif
+# endif
-#else /* !USE_POSIX_TIME */
+#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
tz = CTimeZone;
#endif
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.74 2000/09/29 13:53:31 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.75 2000/10/29 13:17:34 petere Exp $
*
* NOTES
*
#include
#include
-#ifndef USE_POSIX_TIME
+#if !(defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE))
#include
#endif
{
time_t now;
-#ifdef USE_POSIX_TIME
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
struct tm *tm;
now = time(NULL);
-#else /* ! USE_POSIX_TIME */
+#else
struct timeb tb; /* the old V7-ism */
ftime(&tb);
if (!HasCTZSet)
{
-#ifdef USE_POSIX_TIME
#if defined(HAVE_TM_ZONE)
tm = localtime(&now);
CDayLight = tm->tm_isdst;
CTimeZone =
-#ifdef __CYGWIN__
+# ifdef __CYGWIN__
(tm->tm_isdst ? (_timezone - 3600) : _timezone);
-#else
+# else
(tm->tm_isdst ? (timezone - 3600) : timezone);
-#endif
+# endif
strcpy(CTZName, tzname[tm->tm_isdst]);
-#else
-#error USE_POSIX_TIME defined but no time zone available
-#endif
-#else /* ! USE_POSIX_TIME */
+#else /* neither HAVE_TM_ZONE nor HAVE_INT_TIMEZONE */
CTimeZone = tb.timezone * 60;
CDayLight = (tb.dstflag != 0);
abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char *tzn)
{
time_t time = (time_t) _time;
-#ifdef USE_POSIX_TIME
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
struct tm *tx;
-#else /* ! USE_POSIX_TIME */
+#else
struct timeb tb; /* the old V7-ism */
ftime(&tb);
#endif
-#ifdef USE_POSIX_TIME
+
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
if (tzp != NULL)
tx = localtime((time_t *) &time);
else
{
tx = gmtime((time_t *) &time);
};
-#endif
-
-#ifdef USE_POSIX_TIME
tm->tm_year = tx->tm_year + 1900;
tm->tm_mon = tx->tm_mon + 1;
tm->tm_sec = tx->tm_sec;
tm->tm_isdst = tx->tm_isdst;
-#if defined(HAVE_TM_ZONE)
+# if defined(HAVE_TM_ZONE)
tm->tm_gmtoff = tx->tm_gmtoff;
tm->tm_zone = tx->tm_zone;
if (strlen(tm->tm_zone) > MAXTZLEN)
elog(NOTICE, "Invalid timezone \'%s\'", tm->tm_zone);
}
-#elif defined(HAVE_INT_TIMEZONE)
+# elif defined(HAVE_INT_TIMEZONE)
if (tzp != NULL)
-#ifdef __CYGWIN__
+# ifdef __CYGWIN__
*tzp = (tm->tm_isdst ? (_timezone - 3600) : _timezone);
-#else
+# else
*tzp = (tm->tm_isdst ? (timezone - 3600) : timezone);
-#endif
+# endif
if (tzn != NULL)
{
if (strlen(tzname[tm->tm_isdst]) > MAXTZLEN)
elog(NOTICE, "Invalid timezone \'%s\'", tzname[tm->tm_isdst]);
}
-#else
-#error POSIX time support is broken
-#endif
-#else /* ! USE_POSIX_TIME */
+# endif
+#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
if (tzp != NULL)
*tzp = tb.timezone * 60;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.35 2000/08/29 04:41:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.36 2000/10/29 13:17:34 petere Exp $
*
*-------------------------------------------------------------------------
*/
#include
#include
-#ifndef USE_POSIX_TIME
-#include
-#endif
-
#include "access/hash.h"
#include "access/xact.h"
#include "miscadmin.h"
sec;
time_t utime;
-#ifdef USE_POSIX_TIME
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
struct tm *tx;
#endif
{
utime = (dt + (date0 - date2j(1970, 1, 1)) * 86400);
-#ifdef USE_POSIX_TIME
+#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
tx = localtime(&utime);
tm->tm_year = tx->tm_year + 1900;
tm->tm_mon = tx->tm_mon + 1;
#endif
tm->tm_isdst = tx->tm_isdst;
-#if defined(HAVE_TM_ZONE)
+# if defined(HAVE_TM_ZONE)
tm->tm_gmtoff = tx->tm_gmtoff;
tm->tm_zone = tx->tm_zone;
*tzp = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */
if (tzn != NULL)
*tzn = (char *) tm->tm_zone;
-#elif defined(HAVE_INT_TIMEZONE)
-#ifdef __CYGWIN__
+# elif defined(HAVE_INT_TIMEZONE)
+# ifdef __CYGWIN__
*tzp = (tm->tm_isdst ? (_timezone - 3600) : _timezone);
-#else
+# else
*tzp = (tm->tm_isdst ? (timezone - 3600) : timezone);
-#endif
+# endif
if (tzn != NULL)
*tzn = tzname[(tm->tm_isdst > 0)];
-#else
-#error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined
-#endif
+# endif
-#else /* !USE_POSIX_TIME */
+#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
*tzp = CTimeZone; /* V7 conventions; don't know timezone? */
if (tzn != NULL)
*tzn = CTZName;
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_isdst = -1;
tm->tm_year -= 1900;
tm->tm_mon -= 1;
tm->tm_year += 1900;
tm->tm_mon += 1;
-#if defined(HAVE_TM_ZONE)
+# if defined(HAVE_TM_ZONE)
tz = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */
-#elif defined(HAVE_INT_TIMEZONE)
+# elif defined(HAVE_INT_TIMEZONE)
-#ifdef __CYGWIN__
+# ifdef __CYGWIN__
tz = (tm->tm_isdst ? (_timezone - 3600) : _timezone);
-#else
+# else
tz = (tm->tm_isdst ? (timezone - 3600) : timezone);
-#endif
+# endif
-#else
-#error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined
-#endif
+# endif
-#else /* !USE_POSIX_TIME */
+#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
tz = CTimeZone;
#endif
}
-#define USE_POSIX_TIME
#define CLASS_CONFLICT
#define DISABLE_XOPEN_NLS
#define HAS_TEST_AND_SET
#include
#include "kernel/image.h"
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#define NEED_SPARC_TAS_ASM
#endif
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
-#define USE_POSIX_TIME
-
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
-#define USE_POSIX_TIME
-
#if defined(__i386__)
#define NEED_I386_TAS_ASM
#define HAS_TEST_AND_SET
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
typedef struct
{
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
typedef unsigned long slock_t;
-/* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
- here or with -D compile options, but __ macros should be set and used by C
- library macros, not Postgres code. __USE_POSIX is set by features.h,
- __USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
- be used.
-*/
-#define USE_POSIX_TIME
-
#if defined(__i386__)
typedef unsigned char slock_t;
#define HAS_TEST_AND_SET
#endif
-
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
-#ifdef HAVE_INT_TIMEZONE
-#undef HAVE_INT_TIMEZONE
-#endif
-#endif
-
-#if defined(__powerpc__)
-#undef HAVE_INT_TIMEZONE
-#endif
-#define USE_POSIX_TIME
-
#if defined(__i386__)
#define NEED_I386_TAS_ASM
#define HAS_TEST_AND_SET
-#define USE_POSIX_TIME
-
#if defined(__i386__)
#define NEED_I386_TAS_ASM
#define HAS_TEST_AND_SET
#define NOFIXADE
-#define USE_POSIX_TIME
#define DISABLE_XOPEN_NLS
#define HAS_TEST_AND_SET
/*#include */ /* for msemaphore */
#include /* for sem_t */
#endif
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
#define HAVE_STRING_H
#define DISABLE_COMPLEX_MACRO
-#define USE_POSIX_TIME
-
#define HAS_TEST_AND_SET
#define NEED_I386_TAS_ASM
-/* $Header: /cvsroot/pgsql/src/include/port/solaris.h,v 1.2 2000/10/28 22:53:17 petere Exp $ */
+/* $Header: /cvsroot/pgsql/src/include/port/solaris.h,v 1.3 2000/10/29 13:17:34 petere Exp $ */
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
-#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
typedef unsigned char slock_t;
-#define USE_POSIX_TIME
-
#ifndef BYTE_ORDER
#ifdef MIPSEB
#define BYTE_ORDER BIG_ENDIAN
#define NOFIXADE
-#define USE_POSIX_TIME
#define NEED_STRDUP
#ifndef BIG_ENDIAN
-#define USE_POSIX_TIME
-
#define HAS_TEST_AND_SET
#define NEED_I386_TAS_ASM
-#define USE_POSIX_TIME
-
#define HAS_TEST_AND_SET
#define NEED_I386_TAS_ASM
#endif
#define tzname _tzname /* should be in time.h? */
-#define USE_POSIX_TIME
#define HAVE_INT_TIMEZONE /* has int _timezone */
#include