diff options
Diffstat (limited to 'libraries/base/GHC/IO/Handle')
-rw-r--r-- | libraries/base/GHC/IO/Handle/FD.hs | 6 | ||||
-rw-r--r-- | libraries/base/GHC/IO/Handle/Text.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/IO/Handle/Types.hs | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/libraries/base/GHC/IO/Handle/FD.hs b/libraries/base/GHC/IO/Handle/FD.hs index e988b25c9f..786fccc4f1 100644 --- a/libraries/base/GHC/IO/Handle/FD.hs +++ b/libraries/base/GHC/IO/Handle/FD.hs @@ -91,14 +91,14 @@ stdHandleFinalizer fp m = do -- We have to put the FDs into binary mode on Windows to avoid the newline -- translation that the CRT IO library does. setBinaryMode :: FD.FD -> IO () -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) setBinaryMode fd = do _ <- setmode (FD.fdFD fd) True return () #else setBinaryMode _ = return () #endif -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) foreign import ccall unsafe "__hscore_setmode" setmode :: CInt -> Bool -> IO CInt #endif @@ -202,7 +202,7 @@ mkHandleFromFD mkHandleFromFD fd0 fd_type filepath iomode set_non_blocking mb_codec = do -#ifndef mingw32_HOST_OS +#if !defined(mingw32_HOST_OS) -- turn on non-blocking mode fd <- if set_non_blocking then FD.setNonBlockingMode fd0 True diff --git a/libraries/base/GHC/IO/Handle/Text.hs b/libraries/base/GHC/IO/Handle/Text.hs index 8d927384c8..57b9534976 100644 --- a/libraries/base/GHC/IO/Handle/Text.hs +++ b/libraries/base/GHC/IO/Handle/Text.hs @@ -271,7 +271,7 @@ unpack !buf !r !w acc0 -- Here, we are rather careful to only put an *evaluated* character -- in the output string. Due to pointer tagging, this allows the consumer -- to avoid ping-ponging between the actual consumer code and the thunk code -#ifdef CHARBUF_UTF16 +#if defined(CHARBUF_UTF16) -- reverse-order decoding of UTF-16 c2 <- peekElemOff pbuf i if (c2 < 0xdc00 || c2 > 0xdffff) diff --git a/libraries/base/GHC/IO/Handle/Types.hs b/libraries/base/GHC/IO/Handle/Types.hs index 8f739810c4..c58a9fb1b0 100644 --- a/libraries/base/GHC/IO/Handle/Types.hs +++ b/libraries/base/GHC/IO/Handle/Types.hs @@ -46,7 +46,7 @@ import GHC.Read import GHC.Word import GHC.IO.Device import Data.Typeable -#ifdef DEBUG +#if defined(DEBUG) import Control.Monad #endif @@ -179,7 +179,7 @@ isReadWriteHandleType _ = False -- * In a wriite Handle, the Char buffer is always empty (we encode when writing) -- checkHandleInvariants :: Handle__ -> IO () -#ifdef DEBUG +#if defined(DEBUG) checkHandleInvariants h_ = do bbuf <- readIORef (haByteBuffer h_) checkBuffer bbuf @@ -367,7 +367,7 @@ data NewlineMode -- | The native newline representation for the current platform: 'LF' -- on Unix systems, 'CRLF' on Windows. nativeNewline :: Newline -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) nativeNewline = CRLF #else nativeNewline = LF |