fix cabal configure
MIN_VERSION_base macro is not defined at cabal configure time, so check MIN_VERSION_GLASGOW_HASKELL instead.
This commit is contained in:
		
					parent
					
						
							
								d6483deeb1
							
						
					
				
			
			
				commit
				
					
						a0d6ec1c8a
					
				
			
		
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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,8 +79,10 @@ 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)
 | 
			
		||||
	]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue