Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MIN_VERSION_network() instead of CABAL-flag #30

Merged
merged 1 commit into from Sep 26, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions HTTP.cabal
Expand Up @@ -85,22 +85,18 @@ Library
Network.HTTP.Utils Network.HTTP.Utils
Paths_HTTP Paths_HTTP
GHC-options: -fwarn-missing-signatures -Wall GHC-options: -fwarn-missing-signatures -Wall
Build-depends: base >= 2 && < 4.7, parsec Build-depends: base >= 2 && < 4.7, network < 2.5, parsec
Extensions: FlexibleInstances Extensions: FlexibleInstances
if flag(old-base) if flag(old-base)
Build-depends: base < 3 Build-depends: base < 3
else else
Build-depends: base >= 3, array, old-time, bytestring Build-depends: base >= 3, array, old-time, bytestring

if flag(mtl1) if flag(mtl1)
Build-depends: mtl >= 1.1 && < 1.2 Build-depends: mtl >= 1.1 && < 1.2
CPP-Options: -DMTL1 CPP-Options: -DMTL1
else else
Build-depends: mtl >= 2.0 && < 2.2 Build-depends: mtl >= 2.0 && < 2.2
if flag(network23)
Build-depends: network < 2.4
CPP-Options: -DNETWORK23
else
Build-depends: network >= 2.4 && < 2.5


if flag(warn-as-error) if flag(warn-as-error)
ghc-options: -Werror ghc-options: -Werror
Expand All @@ -116,6 +112,7 @@ Test-Suite test
hs-source-dirs: test hs-source-dirs: test
main-is: httpTests.hs main-is: httpTests.hs


-- note: version constraints are inherited from HTTP library stanza
build-depends: HTTP, build-depends: HTTP,
HUnit, HUnit,
httpd-shed, httpd-shed,
Expand All @@ -129,7 +126,7 @@ Test-Suite test
warp >= 1.2 && < 1.3, warp >= 1.2 && < 1.3,
pureMD5 >= 2.1 && < 2.2, pureMD5 >= 2.1 && < 2.2,
base >= 2 && < 4.6, base >= 2 && < 4.6,
network < 2.5, network,
split >= 0.1 && < 0.2, split >= 0.1 && < 0.2,
test-framework, test-framework,
test-framework-hunit test-framework-hunit
Expand Down
6 changes: 3 additions & 3 deletions Network/Browser.hs
Expand Up @@ -1035,10 +1035,10 @@ supportedScheme u = uriScheme u == "http:"
-- If the second argument is not sufficient context for determining -- If the second argument is not sufficient context for determining
-- a full URI then anarchy reins. -- a full URI then anarchy reins.
uriDefaultTo :: URI -> URI -> URI uriDefaultTo :: URI -> URI -> URI
#ifdef NETWORK23 #if MIN_VERSION_network(2,4,0)
uriDefaultTo a b = maybe a id (a `relativeTo` b)
#else
uriDefaultTo a b = a `relativeTo` b uriDefaultTo a b = a `relativeTo` b
#else
uriDefaultTo a b = maybe a id (a `relativeTo` b)
#endif #endif




Expand Down
6 changes: 3 additions & 3 deletions Network/HTTP/Auth.hs
Expand Up @@ -190,10 +190,10 @@ headerToChallenge baseURI (Header _ str) =
} }


annotateURIs :: [Maybe URI] -> [URI] annotateURIs :: [Maybe URI] -> [URI]
#ifdef NETWORK23 #if MIN_VERSION_network(2,4,0)
annotateURIs = (map (\u -> fromMaybe u (u `relativeTo` baseURI))) . catMaybes
#else
annotateURIs = map (`relativeTo` baseURI) . catMaybes annotateURIs = map (`relativeTo` baseURI) . catMaybes
#else
annotateURIs = (map (\u -> fromMaybe u (u `relativeTo` baseURI))) . catMaybes
#endif #endif


-- Change These: -- Change These:
Expand Down