From 8cd48b73c49ffe2685df8bd623b9eeb8de75ed69 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 29 May 2009 13:02:14 +0000 Subject: [PATCH] Fix validate (on Windows) --- System/CPUTime.hsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. -- 1.7.10.4