[project @ 2001-09-05 15:15:33 by sewardj]
authorsewardj <unknown>
Wed, 5 Sep 2001 15:15:33 +0000 (15:15 +0000)
committersewardj <unknown>
Wed, 5 Sep 2001 15:15:33 +0000 (15:15 +0000)
Fix 32-bit breakage.  Int32 is the wrong thing; CInt is probably
right.  I assume that Alpha is LP64, so that on Alpha
   sizeof(int) = 32, sizeof(long) = 64
and that these are both sized at 32 for 32-bit platforms.

ghc/lib/std/CPUTime.hsc

index d5f9b3f..d36efa3 100644 (file)
@@ -1,5 +1,5 @@
 -- -----------------------------------------------------------------------------
--- $Id: CPUTime.hsc,v 1.11 2001/09/05 04:03:15 ken Exp $
+-- $Id: CPUTime.hsc,v 1.12 2001/09/05 15:15:33 sewardj Exp $
 --
 -- (c) The University of Glasgow, 1995-2001
 --
@@ -51,10 +51,10 @@ getCPUTime = do
 
     let ru_utime = (#ptr struct rusage, ru_utime) p_rusage
     let ru_stime = (#ptr struct rusage, ru_stime) p_rusage
-    u_sec  <- (#peek struct timeval,tv_sec)  ru_utime :: IO Int32
-    u_usec <- (#peek struct timeval,tv_usec) ru_utime :: IO Int32
-    s_sec  <- (#peek struct timeval,tv_sec)  ru_stime :: IO Int32
-    s_usec <- (#peek struct timeval,tv_usec) ru_stime :: IO Int32
+    u_sec  <- (#peek struct timeval,tv_sec)  ru_utime :: IO CInt
+    u_usec <- (#peek struct timeval,tv_usec) ru_utime :: IO CInt
+    s_sec  <- (#peek struct timeval,tv_sec)  ru_stime :: IO CInt
+    s_usec <- (#peek struct timeval,tv_usec) ru_stime :: IO CInt
 
     return ((fromIntegral u_sec * 1000000 + fromIntegral u_usec + 
              fromIntegral s_sec * 1000000 + fromIntegral s_usec)