Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@phonohawk

Cabal provides CPP macros to detetermine the version of packages:
http://www.haskell.org/cabal/users-guide/#conditional-compilation

@snoyberg snoyberg merged commit c645740 into snoyberg:text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 4, 2011
  1. @phonohawk
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 11 deletions.
  1. +2 −2 Data/Convertible/Instances/Time.hs
  2. +2 −9 convertible-text.cabal
View
4 Data/Convertible/Instances/Time.hs
@@ -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"
View
11 convertible-text.cabal
@@ -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
Something went wrong with that request. Please try again.