Herold Heiko <[EMAIL PROTECTED]> writes:

> Just a quick note, the current cvs code on windows during compile (with
> VC++6) stops with
>
> cl /I. /DWINDOWS /D_CONSOLE /DHAVE_CONFIG_H /DSYSTEM_WGETRC=\"wgetrc\"
> /DHAVE_SSL /nologo /MT /W0 /O2 /c utils.c
> utils.c
> utils.c(1651) : error C2520: conversion from unsigned __int64 to double not
> implemented, use signed __int64
>
> The culprit seems to be (in wtimer_sys_diff)
>
> #ifdef WINDOWS
>   return (double)(wst1->QuadPart - wst2->QuadPart) / 10000;
> #endif

Does this patch help?

2003-09-16  Hrvoje Niksic  <[EMAIL PROTECTED]>
 
        * utils.c (wtimer_sys_diff): Convert the time difference to signed
        __int64, then to double.  This works around MS VC++ 6 which can't
        convert unsigned __int64 to double directly.

Index: src/utils.c
===================================================================
RCS file: /pack/anoncvs/wget/src/utils.c,v
retrieving revision 1.54
diff -u -r1.54 utils.c
--- src/utils.c 2003/09/15 21:14:15     1.54
+++ src/utils.c 2003/09/16 21:01:02
@@ -1648,7 +1648,10 @@
 #endif
 
 #ifdef WINDOWS
-  return (double)(wst1->QuadPart - wst2->QuadPart) / 10000;
+  /* VC++ 6 doesn't support direct cast of uint64 to double.  To work
+     around this, we subtract, then convert to signed, then finally to
+     double.  */
+  return (double)(signed __int64)(wst1->QuadPart - wst2->QuadPart) / 10000;
 #endif
 }
 

Reply via email to