summaryrefslogtreecommitdiff
path: root/ext/Time
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-10-28 15:54:14 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-10-28 15:54:14 +0000
commitd1e7d2ff615c573e4a2ff7f7775c519d5358cf79 (patch)
treede411f44f8a7a4ba74ec3bd7db3fd33e6a5faa5e /ext/Time
parent12ff0cdc14a84caaf03fdccc6a6f11d477477a8c (diff)
downloadperl-d1e7d2ff615c573e4a2ff7f7775c519d5358cf79.tar.gz
GCC vs MS 64-bit constant syntax
p4raw-id: //depot/perlio@12744
Diffstat (limited to 'ext/Time')
-rw-r--r--ext/Time/HiRes/HiRes.xs11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs
index 952544ead2..e1e13e143a 100644
--- a/ext/Time/HiRes/HiRes.xs
+++ b/ext/Time/HiRes/HiRes.xs
@@ -69,7 +69,12 @@ typedef union {
} FT_t;
/* Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */
-#define EPOCH_BIAS 116444736000000000i64
+#ifdef __GNUC__
+#define Const64(x) x##LL
+#else
+#define Const64(x) x##i64
+#endif
+#define EPOCH_BIAS Const64(116444736000000000)
/* NOTE: This does not compute the timezone info (doing so can be expensive,
* and appears to be unsupported even by glibc) */
@@ -82,10 +87,10 @@ gettimeofday (struct timeval *tp, void *not_used)
GetSystemTimeAsFileTime(&ft.ft_val);
/* seconds since epoch */
- tp->tv_sec = (long)((ft.ft_i64 - EPOCH_BIAS) / 10000000i64);
+ tp->tv_sec = (long)((ft.ft_i64 - EPOCH_BIAS) / Const64(10000000));
/* microseconds remaining */
- tp->tv_usec = (long)((ft.ft_i64 / 10i64) % 1000000i64);
+ tp->tv_usec = (long)((ft.ft_i64 / Const64(10)) % Const64(1000000));
return 0;
}