From: Nick Ing-Simmons Date: Sun, 28 Oct 2001 15:54:14 +0000 (+0000) Subject: GCC vs MS 64-bit constant syntax X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4a4f8bf62726f6e928b5c27bb457067fcfbb235;p=p5sagit%2Fp5-mst-13.2.git GCC vs MS 64-bit constant syntax p4raw-id: //depot/perlio@12744 --- diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index 952544e..e1e13e1 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; }