From 99acb6eceaf59cf8f701ae48c23e140efd4be7f6 Mon Sep 17 00:00:00 2001
From: Ian Lynagh <igloo@earth.li>
Date: Sat, 22 Oct 2011 18:34:51 +0100
Subject: [PATCH] Use time (POSIXTime) rather than old-time (ClockTime)

---
 Trace/Hpc/Mix.hs |   11 +++++++++--
 hpc.cabal        |    3 +++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Trace/Hpc/Mix.hs b/Trace/Hpc/Mix.hs
index 80009c5..3c0890d 100644
--- a/Trace/Hpc/Mix.hs
+++ b/Trace/Hpc/Mix.hs
@@ -20,7 +20,9 @@ module Trace.Hpc.Mix
         )
   where
 
+#if __GLASGOW_HASKELL__ < 703
 import System.Time (ClockTime(..))
+#endif
 import System.Directory (getModificationTime)
 import Data.Maybe (catMaybes)
 import Data.Tree
@@ -115,8 +117,13 @@ mixName dirName name = dirName ++ "/" ++ name ++ ".mix"
 
 getModificationTime :: FilePath -> IO Integer
 getModificationTime file = do
-  (TOD sec _) <- System.Directory.getModificationTime file
-  return $ sec
+#if __GLASGOW_HASKELL__ < 703
+  (TOD secs _) <- System.Directory.getModificationTime file
+  return $ secs
+#else
+  t <- System.Directory.getModificationTime file
+  return $ floor t
+#endif
 
 ------------------------------------------------------------------------------
 
diff --git a/hpc.cabal b/hpc.cabal
index d4fcf43..ba6a2a8 100644
--- a/hpc.cabal
+++ b/hpc.cabal
@@ -27,7 +27,10 @@ Library
     if flag(small_base)
         Build-Depends: base       >= 3   && < 5,
                        directory  >= 1   && < 1.2,
+                       -- TODO: Should conditionally depend on old-time
+                       -- or time, depending on version of directory
                        old-time   >= 1   && < 1.1,
+                       time,
                        containers >= 0.1 && < 0.5
     else
         Build-Depends: base < 3
-- 
1.7.2.5

