From 7783a84ab51ff149885a96498cefcb7f31c27513 Mon Sep 17 00:00:00 2001 From: malcolm Date: Wed, 5 Mar 2003 15:54:59 +0000 Subject: [PATCH] [project @ 2003-03-05 15:54:59 by malcolm] For nhc98, use nullPtr rather than 0 as the argument to time(). --- System/Random.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/System/Random.hs b/System/Random.hs index 129e5a9..e83f525 100644 --- a/System/Random.hs +++ b/System/Random.hs @@ -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 -- 1.7.10.4