Skip to content

Commit

Permalink
Merge pull request #30 from hvr/network24
Browse files Browse the repository at this point in the history
Use `MIN_VERSION_network()` instead of CABAL-flag
  • Loading branch information
hsenag committed Sep 26, 2012
2 parents a9792ef + 21f69c1 commit b7f0c98
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
11 changes: 4 additions & 7 deletions HTTP.cabal
Expand Up @@ -85,22 +85,18 @@ Library
Network.HTTP.Utils
Paths_HTTP
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
if flag(old-base)
Build-depends: base < 3
else
Build-depends: base >= 3, array, old-time, bytestring

if flag(mtl1)
Build-depends: mtl >= 1.1 && < 1.2
CPP-Options: -DMTL1
else
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)
ghc-options: -Werror
Expand All @@ -116,6 +112,7 @@ Test-Suite test
hs-source-dirs: test
main-is: httpTests.hs

-- note: version constraints are inherited from HTTP library stanza
build-depends: HTTP,
HUnit,
httpd-shed,
Expand All @@ -129,7 +126,7 @@ Test-Suite test
warp >= 1.2 && < 1.3,
pureMD5 >= 2.1 && < 2.2,
base >= 2 && < 4.6,
network < 2.5,
network,
split >= 0.1 && < 0.2,
test-framework,
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
-- a full URI then anarchy reins.
uriDefaultTo :: URI -> URI -> URI
#ifdef NETWORK23
uriDefaultTo a b = maybe a id (a `relativeTo` b)
#else
#if MIN_VERSION_network(2,4,0)
uriDefaultTo a b = a `relativeTo` b
#else
uriDefaultTo a b = maybe a id (a `relativeTo` b)
#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]
#ifdef NETWORK23
annotateURIs = (map (\u -> fromMaybe u (u `relativeTo` baseURI))) . catMaybes
#else
#if MIN_VERSION_network(2,4,0)
annotateURIs = map (`relativeTo` baseURI) . catMaybes
#else
annotateURIs = (map (\u -> fromMaybe u (u `relativeTo` baseURI))) . catMaybes
#endif

-- Change These:
Expand Down

0 comments on commit b7f0c98

Please sign in to comment.