[project @ 2003-03-05 15:54:59 by malcolm]
authormalcolm <unknown>
Wed, 5 Mar 2003 15:54:59 +0000 (15:54 +0000)
committermalcolm <unknown>
Wed, 5 Mar 2003 15:54:59 +0000 (15:54 +0000)
For nhc98, use nullPtr rather than 0 as the argument to time().

System/Random.hs

index 129e5a9..e83f525 100644 (file)
@@ -46,6 +46,7 @@ import Prelude
 
 #ifdef __NHC__
 import CPUTime         ( getCPUTime )
+import Foreign.Ptr      ( Ptr, nullPtr )
 #else
 import System.CPUTime  ( getCPUTime )
 import System.Time     ( getClockTime, ClockTime(..) )
@@ -64,9 +65,9 @@ import GHC.IOBase     ( stToIO )
 -- replacement here.
 #ifdef __NHC__
 data ClockTime = TOD Integer ()
-foreign import ccall "time.h time" readtime :: Int -> IO Int
+foreign import ccall "time.h time" readtime :: Ptr () -> IO Int
 getClockTime :: IO ClockTime
-getClockTime = do t <- readtime 0;  return (TOD (toInteger t) ())
+getClockTime = do t <- readtime nullPtr;  return (TOD (toInteger t) ())
 #endif
 
 {- $intro