X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO.hs;h=995991494577fc5a1c9356957b6dfa5b2d0405bd;hb=00de4ab6cf86f437091fe5d8038bd5382dca364b;hp=24a06533a20d99003342df754fd871143a074c72;hpb=23ca6b8a9e91256cc39ad823cdd7a0fc1fdf3ac5;p=ghc-base.git diff --git a/GHC/IO.hs b/GHC/IO.hs index 24a0653..9959914 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,7 +27,7 @@ module GHC.IO ( memcpy_baoff_ptr, ) where -#include "config.h" +#include "ghcconfig.h" import Foreign import Foreign.C @@ -93,7 +93,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 -- --------------------------------------------------------------------------- @@ -410,7 +410,7 @@ hPutChar handle c = LineBuffering -> hPutcBuffered handle_ True c BlockBuffering _ -> hPutcBuffered handle_ False c NoBuffering -> - withObject (castCharToCChar c) $ \buf -> do + with (castCharToCChar c) $ \buf -> do writeRawBufferPtr "hPutChar" (fromIntegral fd) (haIsStream handle_) buf 0 1 return () @@ -563,7 +563,7 @@ commitBuffer commitBuffer hdl raw sz@(I# _) count@(I# _) flush release = do wantWritableHandle "commitAndReleaseBuffer" hdl $ - commitBuffer' hdl raw sz count flush release + commitBuffer' raw sz count flush release -- Explicitly lambda-lift this function to subvert GHC's full laziness -- optimisations, which otherwise tends to float out subexpressions @@ -576,7 +576,7 @@ commitBuffer hdl raw sz@(I# _) count@(I# _) flush release = do -- -- This hack is a fairly big win for hPutStr performance. --SDM 18/9/2001 -- -commitBuffer' hdl raw sz@(I# _) count@(I# _) flush release +commitBuffer' raw sz@(I# _) count@(I# _) flush release handle_@Handle__{ haFD=fd, haBuffer=ref, haBuffers=spare_buf_ref } = do #ifdef DEBUG_DUMP