summaryrefslogtreecommitdiff
path: root/Messages
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-09-06 14:35:24 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-09-06 14:36:15 -0400
commitbc4a8a80b5ccdc3deb47713b1a92b39d4122fb3a (patch)
tree04bdffcead2eb2b4490701101bed26561fd29cde /Messages
parent1aa88da2b47cbd07e8a97920132044645bcd615e (diff)
avoid build warnings when building w/o concurrent-output
Diffstat (limited to 'Messages')
-rw-r--r--Messages/Concurrent.hs8
-rw-r--r--Messages/Progress.hs4
2 files changed, 9 insertions, 3 deletions
diff --git a/Messages/Concurrent.hs b/Messages/Concurrent.hs
index 0e39114dd..91b840231 100644
--- a/Messages/Concurrent.hs
+++ b/Messages/Concurrent.hs
@@ -32,10 +32,12 @@ import GHC.IO.Encoding
- instead.
-}
concurrentMessage :: OutputType -> Bool -> String -> Annex () -> Annex ()
-concurrentMessage o iserror msg fallback
#ifdef WITH_CONCURRENTOUTPUT
+concurrentMessage o iserror msg fallback
| concurrentOutputEnabled o =
go =<< consoleRegion <$> Annex.getState Annex.output
+#else
+concurrentMessage _o _iserror _msg fallback
#endif
| otherwise = fallback
#ifdef WITH_CONCURRENTOUTPUT
@@ -67,8 +69,8 @@ concurrentMessage o iserror msg fallback
- complete.
-}
inOwnConsoleRegion :: OutputType -> Annex a -> Annex a
-inOwnConsoleRegion o a
#ifdef WITH_CONCURRENTOUTPUT
+inOwnConsoleRegion o a
| concurrentOutputEnabled o = do
r <- mkregion
setregion (Just r)
@@ -82,6 +84,8 @@ inOwnConsoleRegion o a
Right ret -> do
rmregion r
return ret
+#else
+inOwnConsoleRegion _o a
#endif
| otherwise = a
#ifdef WITH_CONCURRENTOUTPUT
diff --git a/Messages/Progress.hs b/Messages/Progress.hs
index 1583d922b..c0a88be94 100644
--- a/Messages/Progress.hs
+++ b/Messages/Progress.hs
@@ -45,8 +45,8 @@ metered combinemeterupdate key a = case keySize key of
maybe noop (\m -> m n) combinemeterupdate
liftIO $ clearMeter stdout meter
return r
- go size o@(ConcurrentOutput {})
#if WITH_CONCURRENTOUTPUT
+ go size o@(ConcurrentOutput {})
| concurrentOutputEnabled o = withProgressRegion $ \r -> do
(progress, meter) <- mkmeter size
a $ \n -> liftIO $ do
@@ -54,6 +54,8 @@ metered combinemeterupdate key a = case keySize key of
s <- renderMeter meter
Regions.setConsoleRegion r ("\n" ++ s)
maybe noop (\m -> m n) combinemeterupdate
+#else
+ go _size _o
#endif
| otherwise = nometer