1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Remove now-dead code for !HAVE_INT64_TIMESTAMP.

This is a basically mechanical removal of #ifdef HAVE_INT64_TIMESTAMP
tests and the negative-case controlled code.

Discussion: https://postgr.es/m/26788.1487455319@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2017-02-23 14:04:43 -05:00
parent d28aafb6dd
commit b9d092c962
26 changed files with 28 additions and 1298 deletions

View File

@@ -21,12 +21,9 @@
/*
* Macros for fmgr-callable functions.
*
* For Timestamp, we make use of the same support routines as for int64
* or float8. Therefore Timestamp is pass-by-reference if and only if
* int64 or float8 is!
* For Timestamp, we make use of the same support routines as for int64.
* Therefore Timestamp is pass-by-reference if and only if int64 is!
*/
#ifdef HAVE_INT64_TIMESTAMP
#define DatumGetTimestamp(X) ((Timestamp) DatumGetInt64(X))
#define DatumGetTimestampTz(X) ((TimestampTz) DatumGetInt64(X))
#define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X))
@@ -42,24 +39,6 @@
#define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x)
#define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x)
#define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x)
#else /* !HAVE_INT64_TIMESTAMP */
#define DatumGetTimestamp(X) ((Timestamp) DatumGetFloat8(X))
#define DatumGetTimestampTz(X) ((TimestampTz) DatumGetFloat8(X))
#define DatumGetIntervalP(X) ((Interval *) DatumGetPointer(X))
#define TimestampGetDatum(X) Float8GetDatum(X)
#define TimestampTzGetDatum(X) Float8GetDatum(X)
#define IntervalPGetDatum(X) PointerGetDatum(X)
#define PG_GETARG_TIMESTAMP(n) DatumGetTimestamp(PG_GETARG_DATUM(n))
#define PG_GETARG_TIMESTAMPTZ(n) DatumGetTimestampTz(PG_GETARG_DATUM(n))
#define PG_GETARG_INTERVAL_P(n) DatumGetIntervalP(PG_GETARG_DATUM(n))
#define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x)
#define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x)
#define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x)
#endif /* HAVE_INT64_TIMESTAMP */
#define TIMESTAMP_MASK(b) (1 << (b))
@@ -74,11 +53,7 @@
#define INTERVAL_PRECISION(t) ((t) & INTERVAL_PRECISION_MASK)
#define INTERVAL_RANGE(t) (((t) >> 16) & INTERVAL_RANGE_MASK)
#ifdef HAVE_INT64_TIMESTAMP
#define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) * (int64) 1000))
#else
#define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) / 1000.0))
#endif
/* Set at postmaster start */
@@ -105,13 +80,8 @@ extern bool TimestampDifferenceExceeds(TimestampTz start_time,
* Prototypes for functions to deal with integer timestamps, when the native
* format is float timestamps.
*/
#ifndef HAVE_INT64_TIMESTAMP
extern int64 GetCurrentIntegerTimestamp(void);
extern TimestampTz IntegerTimestampToTimestampTz(int64 timestamp);
#else
#define GetCurrentIntegerTimestamp() GetCurrentTimestamp()
#define IntegerTimestampToTimestampTz(timestamp) (timestamp)
#endif
extern TimestampTz time_t_to_timestamptz(pg_time_t tm);
extern pg_time_t timestamptz_to_time_t(TimestampTz t);