Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use Cabal's MIN_VERSION_package() macro instead of time_gte_113 flag.

Cabal provides CPP macros to detetermine the version of packages:
http://www.haskell.org/cabal/users-guide/#conditional-compilation
  • Loading branch information...
commit e6a2c996819a89c925762e56a20a1cda5daaf597 1 parent 41f43aa
PHO phonohawk authored
Showing with 4 additions and 11 deletions.
  1. +2 −2 Data/Convertible/Instances/Time.hs
  2. +2 −9 convertible-text.cabal
4 Data/Convertible/Instances/Time.hs
View
@@ -36,7 +36,7 @@ import qualified System.Time as ST
import Data.Time
import Data.Time.Clock.POSIX
import Data.Time.Calendar.OrdinalDate
-#ifndef TIME_GTE_113
+#if !MIN_VERSION_time(1,1,3)
import Data.Typeable
#endif
import Data.Ratio
@@ -81,7 +81,7 @@ instance ConvertSuccess Integer ST.ClockTime where
------------------------------ POSIX and UTC times
-#ifndef TIME_GTE_113
+#if !MIN_VERSION_time(1,1,3)
instance Typeable NominalDiffTime where
typeOf _ = mkTypeName "NominalDiffTime"
11 convertible-text.cabal
View
@@ -30,9 +30,6 @@ flag nolib
description: Skip building the library.
default: False
-flag time_gte_113
- description: time > 1.1.3 has defined some more instances so omit them here
-
library
if flag(nolib)
Buildable: False
@@ -44,12 +41,8 @@ library
text >= 0.5 && < 0.12,
bytestring >= 0.9.1.4 && < 0.10,
attempt >= 0.3.0 && < 0.4,
- template-haskell
- if flag(time_gte_113)
- Build-Depends: time>=1.1.3 && <= 1.3
- CPP-OPTIONS: -DTIME_GTE_113
- else
- Build-Depends: time<1.1.3
+ template-haskell,
+ time <= 1.3
GHC-Options: -Wall -fno-warn-orphans
Please sign in to comment.
Something went wrong with that request. Please try again.