projects
/
haskell-directory.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix incorrect changes to C types in a foreign import for nhc98.
[haskell-directory.git]
/
System
/
Random.hs
diff --git
a/System/Random.hs
b/System/Random.hs
index
d6517b1
..
8b648a7
100644
(file)
--- a/
System/Random.hs
+++ b/
System/Random.hs
@@
-70,6
+70,7
@@
import Prelude
#ifdef __NHC__
import CPUTime ( getCPUTime )
import Foreign.Ptr ( Ptr, nullPtr )
#ifdef __NHC__
import CPUTime ( getCPUTime )
import Foreign.Ptr ( Ptr, nullPtr )
+import Foreign.C ( CTime, CUInt )
#else
import System.CPUTime ( getCPUTime )
import System.Time ( getClockTime, ClockTime(..) )
#else
import System.CPUTime ( getCPUTime )
import System.Time ( getClockTime, ClockTime(..) )
@@
-84,9
+85,9
@@
import Numeric ( readDec )
-- replacement here.
#ifdef __NHC__
data ClockTime = TOD Integer ()
-- replacement here.
#ifdef __NHC__
data ClockTime = TOD Integer ()
-foreign import ccall "time.h time" readtime :: Ptr () -> IO Int
+foreign import ccall "time.h time" readtime :: Ptr CTime -> IO CTime
getClockTime :: IO ClockTime
getClockTime :: IO ClockTime
-getClockTime = do t <- readtime nullPtr; return (TOD (toInteger t) ())
+getClockTime = do CTime t <- readtime nullPtr; return (TOD (toInteger t) ())
#endif
-- | The class 'RandomGen' provides a common interface to random number
#endif
-- | The class 'RandomGen' provides a common interface to random number