From 98b0e035f60ac438b22815559cdb3d4e9a313fe6 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 9 Jul 2008 12:31:10 +0000 Subject: [PATCH] FIX BUILD (on Windows) --- GHC/ConsoleHandler.hs | 2 +- GHC/TopHandler.lhs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GHC/ConsoleHandler.hs b/GHC/ConsoleHandler.hs index 8cd5d5e..aaf01c3 100644 --- a/GHC/ConsoleHandler.hs +++ b/GHC/ConsoleHandler.hs @@ -38,7 +38,7 @@ import GHC.IOBase import GHC.Conc import GHC.Handle import Data.Typeable -import Control.Concurrent +import Control.Concurrent.MVar data Handler = Default diff --git a/GHC/TopHandler.lhs b/GHC/TopHandler.lhs index 7077073..cf5123e 100644 --- a/GHC/TopHandler.lhs +++ b/GHC/TopHandler.lhs @@ -37,6 +37,9 @@ import GHC.Exception import GHC.Prim import GHC.Conc import GHC.Weak +#ifdef mingw32_HOST_OS +import GHC.ConsoleHandler +#endif -- | 'runMainIO' is wrapped around 'Main.main' (or whatever main is -- called in the program). It catches otherwise uncaught exceptions, @@ -59,7 +62,7 @@ runMainIO main = install_interrupt_handler :: IO () -> IO () #ifdef mingw32_HOST_OS -install_interrupt_handler handler = +install_interrupt_handler handler = do GHC.ConsoleHandler.installHandler $ Catch $ \event -> case event of @@ -67,6 +70,7 @@ install_interrupt_handler handler = Break -> handler Close -> handler _ -> return () + return () #else #include "Signals.h" -- specialised version of System.Posix.Signals.installHandler, which -- 1.7.10.4