From b11f07a11b92fa4b3eae093bdb0c33f53253aabd Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 24 Sep 2012 18:05:49 +0900 Subject: Conditionals in preview server --- src/Hakyll/Web/Preview/Poll.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Hakyll') diff --git a/src/Hakyll/Web/Preview/Poll.hs b/src/Hakyll/Web/Preview/Poll.hs index 83ec54a..69acdc6 100644 --- a/src/Hakyll/Web/Preview/Poll.hs +++ b/src/Hakyll/Web/Preview/Poll.hs @@ -1,5 +1,6 @@ -- | Interval-based implementation of preview polling -- +{-# LANGUAGE CPP #-} module Hakyll.Web.Preview.Poll ( previewPoll ) where @@ -7,7 +8,11 @@ module Hakyll.Web.Preview.Poll import Control.Applicative ((<$>)) import Control.Concurrent (threadDelay) import Control.Monad (filterM) +#if MIN_VERSION_directory(1,2,0) +import Data.Time (getCurrentTime) +#else import System.Time (getClockTime) +#endif import System.Directory (getModificationTime, doesFileExist) import Hakyll.Core.Configuration @@ -18,7 +23,11 @@ previewPoll :: HakyllConfiguration -- ^ Configuration -> IO [FilePath] -- ^ Updating action -> IO () -- ^ Can block forever previewPoll _ update = do +#if MIN_VERSION_directory(1,2,0) + time <- getCurrentTime +#else time <- getClockTime +#endif loop time =<< update where delay = 1000000 -- cgit v1.2.3