aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-09-16 04:32:28 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-09-16 04:32:28 +0000
commitfc73264005ff8cb316689e30bc28b91d30cd9772 (patch)
treef286e643d66ff1e8f159b7b1ca6196719b26492e
parentb8f8896888e499c4a0ec08dd5b0c5e411a61ec99 (diff)
downloadpostgresql-fc73264005ff8cb316689e30bc28b91d30cd9772.tar.gz
postgresql-fc73264005ff8cb316689e30bc28b91d30cd9772.zip
I don't care whether it's informix-compatible or not: #defining a word
like 'date' in a public header file is a damn fool idea.
-rw-r--r--src/interfaces/ecpg/pgtypeslib/timestamp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c
index 7581df2bf2f..38f735167c2 100644
--- a/src/interfaces/ecpg/pgtypeslib/timestamp.c
+++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c
@@ -68,12 +68,12 @@ tm2timestamp(struct tm * tm, fsec_t fsec, int *tzp, timestamp *result)
dDate = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1);
time = time2t(tm->tm_hour, tm->tm_min, tm->tm_sec, fsec);
#ifdef HAVE_INT64_TIMESTAMP
- *result = (date * INT64CONST(86400000000)) + time;
+ *result = (dDate * INT64CONST(86400000000)) + time;
/* check for major overflow */
- if ((*result - time) / INT64CONST(86400000000) != date)
+ if ((*result - time) / INT64CONST(86400000000) != dDate)
return -1;
/* check for just-barely overflow (okay except time-of-day wraps) */
- if ((*result < 0) ? (date >= 0) : (date < 0))
+ if ((*result < 0) ? (dDate >= 0) : (dDate < 0))
return -1;
#else
*result = ((dDate * 86400) + time);