From dd63cbb7bcfda321a101d1da8628bbbc6b00589b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Oct 2012 21:21:01 -0400 Subject: [PATCH] allow WITH_HOST setting too --- Utility/SRV.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Utility/SRV.hs b/Utility/SRV.hs index d9c70321b4..c43782a568 100644 --- a/Utility/SRV.hs +++ b/Utility/SRV.hs @@ -31,12 +31,14 @@ import Data.Maybe import ADNS.Resolver import Data.Either #else +#ifndef WITH_HOST #ifdef WITH_DNS import qualified Network.DNS.Lookup as DNS import Network.DNS.Resolver import qualified Data.ByteString.UTF8 as B8 #endif #endif +#endif newtype SRV = SRV String deriving (Show, Eq) @@ -62,6 +64,9 @@ lookupSRV (SRV srv) = initResolver [] $ \resolver -> do resolveSRV resolver srv return $ either (\_ -> []) id r #else +#ifdef WITH_HOST +lookupSRV = lookupSRVHost +#else #ifdef WITH_DNS lookupSRV (SRV srv) = do seed <- makeResolvSeed defaultResolvConf @@ -78,6 +83,7 @@ lookupSRV (SRV srv) = do lookupSRV = lookupSRVHost #endif #endif +#endif lookupSRVHost :: SRV -> IO [HostPort] lookupSRVHost (SRV srv)