From 3abbce39d5b6988f06c432dc1a18da1d7dd2f9c3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 4 Jul 2003 18:15:10 +0000 Subject: [PATCH] Fix missing code for HAVE_INT64_TIMESTAMP. --- src/interfaces/ecpg/pgtypeslib/dt.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/interfaces/ecpg/pgtypeslib/dt.h b/src/interfaces/ecpg/pgtypeslib/dt.h index ce40bf9a75..5f68620233 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt.h +++ b/src/interfaces/ecpg/pgtypeslib/dt.h @@ -247,14 +247,23 @@ extern int day_tab[2][13]; || (((y) == UTIME_MAXYEAR) && (((m) < UTIME_MAXMONTH) \ || (((m) == UTIME_MAXMONTH) && ((d) <= UTIME_MAXDAY)))))) -#ifdef HUGE_VAL -#define DT_NOBEGIN (-HUGE_VAL) -#define DT_NOEND (HUGE_VAL) +#ifdef HAVE_INT64_TIMESTAMP + +#define DT_NOBEGIN (-INT64CONST(0x7fffffffffffffff) - 1) +#define DT_NOEND (INT64CONST(0x7fffffffffffffff)) + #else -#define DT_NOBEGIN (-DBL_MAX) -#define DT_NOEND (DBL_MAX) + +#ifdef HUGE_VAL +#define DT_NOBEGIN (-HUGE_VAL) +#define DT_NOEND (HUGE_VAL) +#else +#define DT_NOBEGIN (-DBL_MAX) +#define DT_NOEND (DBL_MAX) #endif +#endif /* HAVE_INT64_TIMESTAMP */ + #define TIMESTAMP_NOBEGIN(j) do {j = DT_NOBEGIN;} while (0) #define TIMESTAMP_NOEND(j) do {j = DT_NOEND;} while (0) #define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN)