From 2833b3347cd0e147d027b2ad0195e9c9cb31fdd5 Mon Sep 17 00:00:00 2001 From: "Malcolm.Wallace@cs.york.ac.uk" Date: Wed, 1 Aug 2007 16:37:50 +0000 Subject: [PATCH] Temporarily fix breakage for nhc98. A recent patch to System.IO introduced a cyclic dependency on Foreign.C.Error, and also inadvertently dragged along System.Posix.Internals which has non-H'98 layout, causing many build problems. The solution for now is to #ifndef __NHC__ all of the recent the openTempFile additions, and mark them non-portable once again. (I also took the opportunity to note a number of other non-portable functions in their Haddock comments.) --- System/IO.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/System/IO.hs b/System/IO.hs index a5b9d7d..8812800 100644 --- a/System/IO.hs +++ b/System/IO.hs @@ -95,7 +95,7 @@ module System.IO ( hIsReadable, hIsWritable, -- :: Handle -> IO Bool hIsSeekable, -- :: Handle -> IO Bool - -- ** Terminal operations + -- ** Terminal operations (not portable: ghc/hugs only) #if !defined(__NHC__) hIsTerminalDevice, -- :: Handle -> IO Bool @@ -104,7 +104,7 @@ module System.IO ( hGetEcho, -- :: Handle -> IO Bool #endif - -- ** Showing handle state + -- ** Showing handle state (not portable: ghc only) #ifdef __GLASGOW_HASKELL__ hShow, -- :: Handle -> IO String @@ -155,18 +155,22 @@ module System.IO ( hGetBufNonBlocking, -- :: Handle -> Ptr a -> Int -> IO Int #endif - -- * Temporary files + -- * Temporary files (not portable: ghc/hugs only) +#if !defined(__NHC__) openTempFile, openBinaryTempFile, +#endif ) where +#ifndef __NHC__ import Data.Bits import Data.List import Data.Maybe import Foreign.C.Error import Foreign.C.String import System.Posix.Internals +#endif #ifdef __GLASGOW_HASKELL__ import GHC.Exception as ExceptionBase hiding (catch) @@ -412,6 +416,7 @@ openBinaryFile = openFile hSetBinaryMode _ _ = return () #endif +#ifndef __NHC__ -- | The function creates a temporary file in ReadWrite mode. -- The created file isn\'t deleted automatically, so you need to delete it manually. openTempFile :: FilePath -- ^ Directory in which to create the file @@ -483,6 +488,7 @@ read_flags = std_flags .|. o_RDONLY write_flags = output_flags .|. o_WRONLY rw_flags = output_flags .|. o_RDWR append_flags = write_flags .|. o_APPEND +#endif -- $locking -- Implementations should enforce as far as possible, at least locally to the -- 1.7.10.4