Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37de660
commit ba18b9e
Showing
2 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,39 @@ | |||
{-# LANGUAGE CPP #-} | |||
|
|||
-- wrapping around different versions of directory, enforcing different time packages to be used. | |||
|
|||
module UHC.Util.Time | |||
( | |||
# ifdef DIRECTORY_USES_UTCTIME | |||
module Data.Time, | |||
module Data.Time.Clock, | |||
ClockTime, | |||
diffClockTimes, | |||
noTimeDiff, | |||
getClockTime | |||
# else | |||
module System.Time | |||
# endif | |||
) | |||
where | |||
|
|||
#ifdef DIRECTORY_USES_UTCTIME | |||
import Data.Time | |||
import Data.Time.Clock | |||
#else | |||
import System.Time | |||
#endif | |||
|
|||
#ifdef DIRECTORY_USES_UTCTIME | |||
-- | a for now alias for old-time ClockTime | |||
type ClockTime = UTCTime | |||
|
|||
diffClockTimes = diffUTCTime | |||
|
|||
noTimeDiff :: NominalDiffTime | |||
noTimeDiff = toEnum 0 | |||
|
|||
getClockTime :: IO ClockTime | |||
getClockTime = getCurrentTime | |||
#endif | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters