diff options
author | Peter Prymmer <PPrymmer@factset.com> | 2001-06-28 06:00:18 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-28 19:32:13 +0000 |
commit | 5cdb7193c99562e084aa84a8d7e591d45d76305a (patch) | |
tree | 6b2620bdd26dffb29d190ae97fbf40da28768e81 | |
parent | 35bc1fdc44cabda9b94bf3b2cbffe0be67fef25d (diff) | |
download | perl-5cdb7193c99562e084aa84a8d7e591d45d76305a.tar.gz |
s/qdiv/div/ in Time::HiRes for VAX
Message-ID: <Pine.OSF.4.10.10106281125220.508935-100000@aspara.forte.com>
(unfinished: time/hires tests 3, 5, 14 failing, but better
than wholesale failure)
p4raw-id: //depot/perl@11011
-rw-r--r-- | ext/Time/HiRes/HiRes.xs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index db0592aac2..83db8664f0 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -107,15 +107,23 @@ gettimeofday (struct timeval *tp, int nothing) */ static $DESCRIPTOR(dscepoch,"01-JAN-1970 00:00:00.00"); +#ifdef __VAX +static long base_adjust=0L; +#else static __int64 base_adjust=0; +#endif int gettimeofday (struct timeval *tp, void *tpz) { long ret; +#ifdef __VAX + long quad; + div_t ans1,ans2; +#else __int64 quad; __qdiv_t ans1,ans2; - +#endif /* In case of error, tv_usec = 0 and tv_sec = VMS condition code. The return from function is also set to -1. @@ -135,8 +143,13 @@ gettimeofday (struct timeval *tp, void *tpz) ret=sys$gettim(&quad); /* Get VMS system time */ if ((1 && ret) == 1) { quad -= base_adjust; /* convert to epoch offset */ +#ifdef __VAX + ans1=div(quad,DIV_100NS_TO_SECS); + ans2=div(ans1.rem,DIV_100NS_TO_USECS); +#else ans1=qdiv(quad,DIV_100NS_TO_SECS); ans2=qdiv(ans1.rem,DIV_100NS_TO_USECS); +#endif tp->tv_sec = ans1.quot; /* Whole seconds */ tp->tv_usec = ans2.quot; /* Micro-seconds */ } else { |