X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO.hs;h=6cc8aaac298d144d546d5cb5881b12308d7d0af5;hb=bb534f206682be14daf72b33c6105ab27295c6ac;hp=29fdc6001fe7ae6bfbb2a7e3c311ecdd0dc3a808;hpb=3bc707020c8d0f7a11b652c38d33f1d9c87d3ae7;p=ghc-base.git diff --git a/GHC/IO.hs b/GHC/IO.hs index 29fdc60..6cc8aaa 100644 --- a/GHC/IO.hs +++ b/GHC/IO.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -fno-implicit-prelude -#include "HsBase.h" #-} +{-# OPTIONS_GHC -fno-implicit-prelude -#include "HsBase.h" #-} #undef DEBUG_DUMP @@ -27,8 +27,6 @@ module GHC.IO ( memcpy_baoff_ptr, ) where -#include "ghcconfig.h" - import Foreign import Foreign.C @@ -47,7 +45,7 @@ import GHC.Show import GHC.List import GHC.Exception ( ioError, catch ) -#ifdef mingw32_TARGET_OS +#ifdef mingw32_HOST_OS import GHC.Conc #endif @@ -93,7 +91,7 @@ hWaitForInput h msecs = do (fromIntegral msecs) (haIsStream handle_) return (r /= 0) -foreign import ccall unsafe "inputReady" +foreign import ccall safe "inputReady" inputReady :: CInt -> CInt -> Bool -> IO CInt -- --------------------------------------------------------------------------- @@ -727,7 +725,7 @@ writeChunkNonBlocking fd is_stream ptr bytes = loop 0 bytes loop :: Int -> Int -> IO Int loop off bytes | bytes <= 0 = return off loop off bytes = do -#ifndef mingw32_TARGET_OS +#ifndef mingw32_HOST_OS ssize <- c_write (fromIntegral fd) (ptr `plusPtr` off) (fromIntegral bytes) let r = fromIntegral ssize :: Int if (r == -1) @@ -901,7 +899,7 @@ bufReadNonBlocking fd ref is_stream ptr so_far count = readChunkNonBlocking :: FD -> Bool -> Ptr a -> Int -> IO Int readChunkNonBlocking fd is_stream ptr bytes = do -#ifndef mingw32_TARGET_OS +#ifndef mingw32_HOST_OS ssize <- c_read (fromIntegral fd) (castPtr ptr) (fromIntegral bytes) let r = fromIntegral ssize :: Int if (r == -1)