develooper Front page | perl.perl5.porters | Postings from April 2007

[PATCH] VC6 compatibility issue with shared.xs

Thread Next
From:
Jan Dubois
Date:
April 9, 2007 13:17
Subject:
[PATCH] VC6 compatibility issue with shared.xs
Message ID:
926l135uuebi1jrtjetkfoqclsqn2omt69@4ax.com
VC6 without the "Visual C++ Processor Pack" doesn't support conversion
from unsigned __int64 to double:

  error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64

I would prefer if core Perl module could be compiled without the Processor
Pack installed, as it is not available for all versions and service pack
levels of VC6.

The attached patch just does an opportunistic cast into signed __int64.
But maybe you would prefer to change the definition of now.i64 to
be signed instead...

Cheers,
-Jan

--- ext/threads/shared/shared.xs.orig   Mon Mar 19 09:43:55 2007
+++ ext/threads/shared/shared.xs        Mon Apr 09 12:31:24 2007
@@ -569,7 +569,7 @@
     GetSystemTimeAsFileTime(&now.ft);

     /* Relative time in milliseconds */
-    rel = (abs * 1000.) - (((double)now.i64 / 10000.) - EPOCH_BIAS);
+    rel = (abs * 1000.) - (((double)(__int64)now.i64 / 10000.) - EPOCH_BIAS);

     if (rel <= 0.0) {
         return (0);


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