summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-07-05 17:08:11 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-07-05 17:08:11 -0400
commitc87785692855f40d1507da6eb2c52ade63365479 (patch)
treea09a47c6edb75c2251561dd46b100fadafe12aaf /Utility
parentc8256b6cbb8853f0cea09582e98978082cdd3cc8 (diff)
fix cabal configure
MIN_VERSION_base macro is not defined at cabal configure time, so check MIN_VERSION_GLASGOW_HASKELL instead.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Exception.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Utility/Exception.hs b/Utility/Exception.hs
index f6551b455..0ffc7103f 100644
--- a/Utility/Exception.hs
+++ b/Utility/Exception.hs
@@ -28,9 +28,11 @@ module Utility.Exception (
import Control.Monad.Catch as X hiding (Handler)
import qualified Control.Monad.Catch as M
import Control.Exception (IOException, AsyncException)
-#if MIN_VERSION_base(4,7,0)
+#ifdef MIN_VERSION_GLASGOW_HASKELL
+#if MIN_VERSION_GLASGOW_HASKELL(7,10,0,0)
import Control.Exception (SomeAsyncException)
#endif
+#endif
import Control.Monad
import Control.Monad.IO.Class (liftIO, MonadIO)
import System.IO.Error (isDoesNotExistError, ioeGetErrorType)
@@ -77,9 +79,11 @@ bracketIO setup cleanup = bracket (liftIO setup) (liftIO . cleanup)
catchNonAsync :: MonadCatch m => m a -> (SomeException -> m a) -> m a
catchNonAsync a onerr = a `catches`
[ M.Handler (\ (e :: AsyncException) -> throwM e)
-#if MIN_VERSION_base(4,7,0)
+#ifdef MIN_VERSION_GLASGOW_HASKELL
+#if MIN_VERSION_GLASGOW_HASKELL(7,10,0,0)
, M.Handler (\ (e :: SomeAsyncException) -> throwM e)
#endif
+#endif
, M.Handler (\ (e :: SomeException) -> onerr e)
]