|
6 | 6 | * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group |
7 | 7 | * Portions Copyright (c) 1994, Regents of the University of California |
8 | 8 | * |
9 | | - * $Id: timestamp.h,v 1.14 2001/01/24 19:43:29 momjian Exp $ |
| 9 | + * $Id: timestamp.h,v 1.15 2001/03/14 20:12:10 tgl Exp $ |
10 | 10 | * |
11 | 11 | *------------------------------------------------------------------------- |
12 | 12 | */ |
@@ -74,36 +74,24 @@ typedef struct |
74 | 74 | #define DT_CURRENT (DBL_MIN) |
75 | 75 | #define DT_EPOCH (-DBL_MIN) |
76 | 76 |
|
77 | | -#define TIMESTAMP_INVALID(j) do {j = DT_INVALID;} while (0) |
| 77 | +#define TIMESTAMP_INVALID(j) do {j = DT_INVALID;} while (0) |
78 | 78 | #ifdef NAN |
79 | 79 | #define TIMESTAMP_IS_INVALID(j) (isnan(j)) |
80 | 80 | #else |
81 | | -#define TIMESTAMP_IS_INVALID(j) (j == DT_INVALID) |
| 81 | +#define TIMESTAMP_IS_INVALID(j) ((j) == DT_INVALID) |
82 | 82 | #endif |
83 | 83 |
|
84 | | -#define TIMESTAMP_NOBEGIN(j) do {j = DT_NOBEGIN;} while (0) |
85 | | -#define TIMESTAMP_IS_NOBEGIN(j) (j == DT_NOBEGIN) |
| 84 | +#define TIMESTAMP_NOBEGIN(j) do {j = DT_NOBEGIN;} while (0) |
| 85 | +#define TIMESTAMP_IS_NOBEGIN(j) ((j) == DT_NOBEGIN) |
86 | 86 |
|
87 | 87 | #define TIMESTAMP_NOEND(j) do {j = DT_NOEND;} while (0) |
88 | | -#define TIMESTAMP_IS_NOEND(j) (j == DT_NOEND) |
| 88 | +#define TIMESTAMP_IS_NOEND(j) ((j) == DT_NOEND) |
89 | 89 |
|
90 | | -#define TIMESTAMP_CURRENT(j) do {j = DT_CURRENT;} while (0) |
91 | | -#if defined(linux) && defined(__powerpc__) |
92 | | -extern int timestamp_is_current(double j); |
93 | | - |
94 | | -#define TIMESTAMP_IS_CURRENT(j) timestamp_is_current(j) |
95 | | -#else |
96 | | -#define TIMESTAMP_IS_CURRENT(j) (j == DT_CURRENT) |
97 | | -#endif |
| 90 | +#define TIMESTAMP_CURRENT(j) do {j = DT_CURRENT;} while (0) |
| 91 | +#define TIMESTAMP_IS_CURRENT(j) ((j) == DT_CURRENT) |
98 | 92 |
|
99 | 93 | #define TIMESTAMP_EPOCH(j) do {j = DT_EPOCH;} while (0) |
100 | | -#if defined(linux) && defined(__powerpc__) |
101 | | -extern int timestamp_is_epoch(double j); |
102 | | - |
103 | | -#define TIMESTAMP_IS_EPOCH(j) timestamp_is_epoch(j) |
104 | | -#else |
105 | | -#define TIMESTAMP_IS_EPOCH(j) (j == DT_EPOCH) |
106 | | -#endif |
| 94 | +#define TIMESTAMP_IS_EPOCH(j) ((j) == DT_EPOCH) |
107 | 95 |
|
108 | 96 | #define TIMESTAMP_IS_RELATIVE(j) (TIMESTAMP_IS_CURRENT(j) || TIMESTAMP_IS_EPOCH(j)) |
109 | 97 | #define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_INVALID(j) \ |
|
0 commit comments