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

Re: [PATCH] VC6 compatibility issue with shared.xs

Thread Previous | Thread Next
From:
Jerry D. Hedden
Date:
April 10, 2007 01:36
Subject:
Re: [PATCH] VC6 compatibility issue with shared.xs
Message ID:
1ff86f510704091327j4c81c9acj60353090b80ba7b2@mail.gmail.com
It would probably be better to do the division first:

    rel = (abs * 1000.) - (now.i64 / 10000) - EPOCH_BIAS);

Does this require any casting, or will it just work?

On 4/9/07, Jan Dubois <jand@activestate.com> wrote:
> 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 Previous | 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