[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:59:58 UTC 2010


The following commit has been merged in the master branch:
commit 043f2a1141fd4b1b9e89d00afe8feb7a7c3b66e1
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Jul 22 20:49:38 2005 +0100

    Additional compilation fixes

diff --git a/MissingH/IO/StatCompat.hs b/MissingH/IO/StatCompat.hs
index 38e7b83..35ad38a 100644
--- a/MissingH/IO/StatCompat.hs
+++ b/MissingH/IO/StatCompat.hs
@@ -43,6 +43,8 @@ type LinkCount = Int
 type UserID = Int
 type GroupID = Int
 
+#endif
+
 blockSpecialMode :: FileMode
 blockSpecialMode = 0o0060000
 
@@ -58,15 +60,14 @@ regularFileMode = 0o0100000
 directoryMode :: FileMode
 directoryMode = 0o0040000
 
-symbolicLinkMode :: FileMode
-symbolicLinkMode = 0o0120000
+fileTypeModes :: FileMode
+fileTypeModes = 0o00170000
 
 socketMode :: FileMode
 socketMode = 0o0140000
 
-fileTypeModes :: FileMode
-fileTypeModes = 0o00170000
-#endif
+symbolicLinkMode :: FileMode
+symbolicLinkMode = 0o0120000
 
 data FileStatusCompat = 
     FileStatusCompat {deviceID :: DeviceID,
diff --git a/MissingH/Time.hs b/MissingH/Time.hs
index c8d4495..a24e72b 100644
--- a/MissingH/Time.hs
+++ b/MissingH/Time.hs
@@ -37,7 +37,8 @@ module MissingH.Time(
                      timegm,
                      timeDiffToSecs,
                      epoch,
-                     epochToClockTime
+                     epochToClockTime,
+                     clockTimeToEpoch
                     )
 where
 import System.Time
@@ -109,3 +110,10 @@ epochToClockTime x =
           secfrac = floor $ (ratval - (seconds % 1) ) * picosecondfactor
           picosecondfactor = 10 ^ 12
           
+{- | Converts a ClockTime to something represented with an arbitrary Real.
+The result could be treated as a CTime from Foreign.C.Types or EpochTime from
+System.Posix.Types.  The inverse of 'epochToClockTime'.
+
+Fractions of a second are not preserved by this function. -}
+clockTimeToEpoch :: Num a => ClockTime -> a
+clockTimeToEpoch (TOD sec _) = fromInteger sec

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list