X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FConsoleHandler.hs;h=562ef32a675dea35d856c63fa483a825bc24addb;hb=88f389fc1807aac92b4b026c2b09b2ec6266d05b;hp=1300c9624c08dde93d24b2185e03c929ce88edcd;hpb=2bd1dc47b168dfbd253e5d86cbcc1627ccf2e8c2;p=ghc-base.git diff --git a/GHC/ConsoleHandler.hs b/GHC/ConsoleHandler.hs index 1300c96..562ef32 100644 --- a/GHC/ConsoleHandler.hs +++ b/GHC/ConsoleHandler.hs @@ -1,4 +1,5 @@ -{-# OPTIONS_GHC -cpp #-} +{-# LANGUAGE CPP, ForeignFunctionInterface #-} + ----------------------------------------------------------------------------- -- | -- Module : GHC.ConsoleHandler @@ -26,7 +27,7 @@ module GHC.ConsoleHandler ) where {- -#include "Signals.h" +#include "rts/Signals.h" -} import Foreign @@ -39,6 +40,11 @@ import GHC.Conc import Control.Concurrent.MVar import Data.Typeable +#ifdef mingw32_HOST_OS +import Data.Maybe +import GHC.Base +#endif + data Handler = Default | Ignore @@ -141,7 +147,7 @@ flushConsole h = "handle is not a file descriptor" Nothing Nothing Just fd -> do throwErrnoIfMinus1Retry_ "flushConsole" $ - flush_console_fd (fromIntegral (fdFD fd)) + flush_console_fd (fdFD fd) foreign import ccall unsafe "consUtils.h flush_input_console__" flush_console_fd :: CInt -> IO CInt