*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.60 2001/01/24 19:43:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.61 2001/03/14 20:12:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return 0;
} /* EncodeTimeSpan() */
-
-
-#if defined(linux) && defined(__powerpc__)
-
-int
-timestamp_is_epoch(double j)
-{
- static union
- {
- double epoch;
- unsigned char c[8];
- } u;
-
- u.c[0] = 0x80; /* sign bit */
- u.c[1] = 0x10; /* DBL_MIN */
-
- return j == u.epoch;
-}
-int
-timestamp_is_current(double j)
-{
- static union
- {
- double current;
- unsigned char c[8];
- } u;
-
- u.c[1] = 0x10; /* DBL_MIN */
-
- return j == u.current;
-}
-
-#endif
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: timestamp.h,v 1.14 2001/01/24 19:43:29 momjian Exp $
+ * $Id: timestamp.h,v 1.15 2001/03/14 20:12:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#define DT_CURRENT (DBL_MIN)
#define DT_EPOCH (-DBL_MIN)
-#define TIMESTAMP_INVALID(j) do {j = DT_INVALID;} while (0)
+#define TIMESTAMP_INVALID(j) do {j = DT_INVALID;} while (0)
#ifdef NAN
#define TIMESTAMP_IS_INVALID(j) (isnan(j))
#else
-#define TIMESTAMP_IS_INVALID(j) (j == DT_INVALID)
+#define TIMESTAMP_IS_INVALID(j) ((j) == DT_INVALID)
#endif
-#define TIMESTAMP_NOBEGIN(j) do {j = DT_NOBEGIN;} while (0)
-#define TIMESTAMP_IS_NOBEGIN(j) (j == DT_NOBEGIN)
+#define TIMESTAMP_NOBEGIN(j) do {j = DT_NOBEGIN;} while (0)
+#define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN)
#define TIMESTAMP_NOEND(j) do {j = DT_NOEND;} while (0)
-#define TIMESTAMP_IS_NOEND(j) (j == DT_NOEND)
+#define TIMESTAMP_IS_NOEND(j) ((j) == DT_NOEND)
-#define TIMESTAMP_CURRENT(j) do {j = DT_CURRENT;} while (0)
-#if defined(linux) && defined(__powerpc__)
-extern int timestamp_is_current(double j);
-
-#define TIMESTAMP_IS_CURRENT(j) timestamp_is_current(j)
-#else
-#define TIMESTAMP_IS_CURRENT(j) (j == DT_CURRENT)
-#endif
+#define TIMESTAMP_CURRENT(j) do {j = DT_CURRENT;} while (0)
+#define TIMESTAMP_IS_CURRENT(j) ((j) == DT_CURRENT)
#define TIMESTAMP_EPOCH(j) do {j = DT_EPOCH;} while (0)
-#if defined(linux) && defined(__powerpc__)
-extern int timestamp_is_epoch(double j);
-
-#define TIMESTAMP_IS_EPOCH(j) timestamp_is_epoch(j)
-#else
-#define TIMESTAMP_IS_EPOCH(j) (j == DT_EPOCH)
-#endif
+#define TIMESTAMP_IS_EPOCH(j) ((j) == DT_EPOCH)
#define TIMESTAMP_IS_RELATIVE(j) (TIMESTAMP_IS_CURRENT(j) || TIMESTAMP_IS_EPOCH(j))
#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_INVALID(j) \