Skip to content
This repository

Use `MIN_VERSION_network()` instead of CABAL-flag #30

Merged
merged 1 commit into from almost 2 years ago

2 participants

Herbert Valerio Riedel Ganesh Sittampalam
Herbert Valerio Riedel
Owner

...for providing network-2.4 compatibility

This replaces the CABAL-flag based approach used in
7a26621 with a MIN_VERSION_network()-macro
based one, making it a bit simpler for the CABAL solver.

Herbert Valerio Riedel hvr Use `MIN_VERSION_network()` instead of CABAL-flag
...for providing `network-2.4` compatibility

This replaces the CABAL-flag based approach used in
7a266219284ff33d66fa5e3f67f406c2616feab5 with a `MIN_VERSION_network()`-macro
based one, making it a bit simpler for the CABAL solver.
21f69c1
Ganesh Sittampalam hsenag merged commit b7f0c98 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 18, 2012
Herbert Valerio Riedel hvr Use `MIN_VERSION_network()` instead of CABAL-flag
...for providing `network-2.4` compatibility

This replaces the CABAL-flag based approach used in
7a266219284ff33d66fa5e3f67f406c2616feab5 with a `MIN_VERSION_network()`-macro
based one, making it a bit simpler for the CABAL solver.
21f69c1
This page is out of date. Refresh to see the latest.

Showing 3 changed files with 10 additions and 13 deletions. Show diff stats Hide diff stats

  1. +4 7 HTTP.cabal
  2. +3 3 Network/Browser.hs
  3. +3 3 Network/HTTP/Auth.hs
11 HTTP.cabal
@@ -85,22 +85,18 @@ Library
85 85 Network.HTTP.Utils
86 86 Paths_HTTP
87 87 GHC-options: -fwarn-missing-signatures -Wall
88   - Build-depends: base >= 2 && < 4.7, parsec
  88 + Build-depends: base >= 2 && < 4.7, network < 2.5, parsec
89 89 Extensions: FlexibleInstances
90 90 if flag(old-base)
91 91 Build-depends: base < 3
92 92 else
93 93 Build-depends: base >= 3, array, old-time, bytestring
  94 +
94 95 if flag(mtl1)
95 96 Build-depends: mtl >= 1.1 && < 1.2
96 97 CPP-Options: -DMTL1
97 98 else
98 99 Build-depends: mtl >= 2.0 && < 2.2
99   - if flag(network23)
100   - Build-depends: network < 2.4
101   - CPP-Options: -DNETWORK23
102   - else
103   - Build-depends: network >= 2.4 && < 2.5
104 100
105 101 if flag(warn-as-error)
106 102 ghc-options: -Werror
@@ -116,6 +112,7 @@ Test-Suite test
116 112 hs-source-dirs: test
117 113 main-is: httpTests.hs
118 114
  115 + -- note: version constraints are inherited from HTTP library stanza
119 116 build-depends: HTTP,
120 117 HUnit,
121 118 httpd-shed,
@@ -129,7 +126,7 @@ Test-Suite test
129 126 warp >= 1.2 && < 1.3,
130 127 pureMD5 >= 2.1 && < 2.2,
131 128 base >= 2 && < 4.6,
132   - network < 2.5,
  129 + network,
133 130 split >= 0.1 && < 0.2,
134 131 test-framework,
135 132 test-framework-hunit
6 Network/Browser.hs
@@ -1035,10 +1035,10 @@ supportedScheme u = uriScheme u == "http:"
1035 1035 -- If the second argument is not sufficient context for determining
1036 1036 -- a full URI then anarchy reins.
1037 1037 uriDefaultTo :: URI -> URI -> URI
1038   -#ifdef NETWORK23
1039   -uriDefaultTo a b = maybe a id (a `relativeTo` b)
1040   -#else
  1038 +#if MIN_VERSION_network(2,4,0)
1041 1039 uriDefaultTo a b = a `relativeTo` b
  1040 +#else
  1041 +uriDefaultTo a b = maybe a id (a `relativeTo` b)
1042 1042 #endif
1043 1043
1044 1044
6 Network/HTTP/Auth.hs
@@ -190,10 +190,10 @@ headerToChallenge baseURI (Header _ str) =
190 190 }
191 191
192 192 annotateURIs :: [Maybe URI] -> [URI]
193   -#ifdef NETWORK23
194   - annotateURIs = (map (\u -> fromMaybe u (u `relativeTo` baseURI))) . catMaybes
195   -#else
  193 +#if MIN_VERSION_network(2,4,0)
196 194 annotateURIs = map (`relativeTo` baseURI) . catMaybes
  195 +#else
  196 + annotateURIs = (map (\u -> fromMaybe u (u `relativeTo` baseURI))) . catMaybes
197 197 #endif
198 198
199 199 -- Change These:

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.