Change 11011 by jhi@alpha on 2001/06/28 19:32:13

        Subject: [PATCH: perl@11006] s/qdiv/div/ in Time::HiRes for VAX
        From: Peter Prymmer <[EMAIL PROTECTED]>
        Date: Thu, 28 Jun 2001 13:00:18 -0700 (PDT)
        Message-ID: <[EMAIL PROTECTED]>
        
        (unfinished: time/hires tests 3, 5, 14 failing, but better
        than wholesale failure)

Affected files ...

... //depot/perl/ext/Time/HiRes/HiRes.xs#7 edit

Differences ...

==== //depot/perl/ext/Time/HiRes/HiRes.xs#7 (text) ====
Index: perl/ext/Time/HiRes/HiRes.xs
--- perl/ext/Time/HiRes/HiRes.xs.~1~    Thu Jun 28 13:45:05 2001
+++ perl/ext/Time/HiRes/HiRes.xs        Thu Jun 28 13:45:05 2001
@@ -107,15 +107,23 @@
 */
 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 @@
  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 {
End of Patch.

Reply via email to