develooper Front page | perl.perl5.porters | Postings from January 2004

[PATCH] Time::HiRes Const64() (blead)

Thread Next
From:
Mike Pomraning
Date:
January 14, 2004 01:45
Subject:
[PATCH] Time::HiRes Const64() (blead)
Message ID:
Pine.LNX.4.58.0401132239380.13427@localhost.localdomain
On XP 5.1.2600 and mingw32, bleadperl (to 22125) fails to compile with the
following error:

  HiRes.xs: In function `_gettimeofday':
  HiRes.xs:196: invalid suffix on integer constant
  HiRes.xs:197: invalid suffix on integer constant

With the following tiny patch, all is well:

--------------------------------------------------------
--- ext/Time/HiRes/HiRes.xs.orig	2004-01-13 22:06:06.265625000 -0600
+++ ext/Time/HiRes/HiRes.xs	2004-01-13 22:08:28.484375000 -0600
@@ -193,8 +193,8 @@
         QueryPerformanceCounter((LARGE_INTEGER*)&ticks);
         ticks -= MY_CXT.base_ticks;
         ft.ft_i64 = MY_CXT.base_systime_as_filetime.ft_i64
-                    + 10000000i64 * (ticks / MY_CXT.tick_frequency)
-                    +(10000000i64 * (ticks % MY_CXT.tick_frequency)) / MY_CXT.tick_frequency;
+                    + Const64(10000000) * (ticks / MY_CXT.tick_frequency)
+                    +(Const64(10000000) * (ticks % MY_CXT.tick_frequency)) / MY_CXT.tick_frequency;
     }
     else {
         QueryPerformanceFrequency((LARGE_INTEGER*)&MY_CXT.tick_frequency);
--------------------------------------------------------

-Mike

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About