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