From: Simon Marlow Date: Fri, 29 May 2009 13:02:14 +0000 (+0000) Subject: Fix validate (on Windows) X-Git-Tag: 2009-06-25~27 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8cd48b73c49ffe2685df8bd623b9eeb8de75ed69;p=ghc-base.git Fix validate (on Windows) --- diff --git a/System/CPUTime.hsc b/System/CPUTime.hsc index 307b2a2..7fe4fc2 100644 --- a/System/CPUTime.hsc +++ b/System/CPUTime.hsc @@ -37,10 +37,12 @@ import Foreign.C #include "HsBase.h" #endif +#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) realToInteger :: Real a => a -> Integer realToInteger ct = round (realToFrac ct :: Double) -- CTime, CClock, CUShort etc are in Real but not Fractional, -- so we must convert to Double before we can round it +#endif #ifdef __GLASGOW_HASKELL__ -- ----------------------------------------------------------------------------- @@ -115,7 +117,7 @@ foreign import ccall unsafe times :: Ptr CTms -> IO CClock low <- (#peek FILETIME,dwLowDateTime) ft :: IO Word32 -- Convert 100-ns units to picosecs (10^-12) -- => multiply by 10^5. - return (((fromIntegral high) * (2^32) + (fromIntegral low)) * 100000) + return (((fromIntegral high) * (2^(32::Int)) + (fromIntegral low)) * 100000) -- ToDo: pin down elapsed times to just the OS thread(s) that -- are evaluating/managing Haskell code.