use cabal macro to detect if old version of network is being used

This commit is contained in:
Joey Hess 2012-11-11 18:05:01 -04:00
parent 39cd705952
commit 7c30be0e8c
3 changed files with 9 additions and 1 deletions

View file

@ -119,6 +119,11 @@ request url headers requesttype = go 5 url
Nothing -> return rsp
Just newURI -> go n newURI_abs
where
#if defined VERSION_network
#if ! MIN_VERSION_network(2,4,0)
#define WITH_OLD_URI
#endif
#endif
#ifdef WITH_OLD_URI
newURI_abs = fromMaybe newURI (newURI `relativeTo` u)
#else

View file

@ -7,3 +7,6 @@ Do you think it's possible to support *both* versions of the network library, ma
That would increase the portability of git-annex quite a bit.
Thank you for your consideration.
> Ok, I think I've figured out how to use the CPP macros defined by cabal
> to deal with this. [[done]], will be in next release. --[[Joey]]

View file

@ -52,7 +52,7 @@ Flag DNS
Executable git-annex
Main-Is: git-annex.hs
Build-Depends: MissingH, hslogger, directory, filepath,
unix, containers, utf8-string, network (>= 2.4.0.1), mtl,
unix, containers, utf8-string, network (>= 2.0), mtl,
bytestring, old-locale, time,
pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP,
base (>= 4.5 && < 4.7), monad-control, transformers-base, lifted-base,