From: Malcolm.Wallace@cs.york.ac.uk Date: Mon, 15 Jun 2009 15:52:49 +0000 (+0000) Subject: Allow System.Posix.Internals to compile with nhc98 again. X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=5bea16bf551dd337725af4a3a7640641eb11f5e9 Allow System.Posix.Internals to compile with nhc98 again. Also affects GHC.IO.Device, which is not very GHC-specific at all. --- diff --git a/GHC/IO/Device.hs b/GHC/IO/Device.hs index ab91bc0..5010fef 100644 --- a/GHC/IO/Device.hs +++ b/GHC/IO/Device.hs @@ -21,6 +21,7 @@ module GHC.IO.Device ( SeekMode(..) ) where +#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Word import GHC.Arr @@ -32,6 +33,13 @@ import Data.Maybe import GHC.Num import GHC.IO import {-# SOURCE #-} GHC.IO.Exception ( unsupportedOperation ) +#endif +#ifdef __NHC__ +import Foreign +import Ix +import Control.Exception.Base +unsupportedOperation = userError "unsupported operation" +#endif -- | A low-level I/O provider where the data is bytes in memory. class RawIO a where diff --git a/Makefile.nhc98 b/Makefile.nhc98 index 8cffa95..1eb03ae 100644 --- a/Makefile.nhc98 +++ b/Makefile.nhc98 @@ -9,7 +9,7 @@ DIRS = \ Data Debug Control Control/Monad System System/IO System/Console \ Text Text/Html Text/Show Text/ParserCombinators Text/Regex \ Foreign Foreign/Marshal Foreign/C NHC Unsafe System/Posix \ - Control/Exception + Control/Exception GHC GHC/IO SRCS = \ Data/Bits.hs Data/Bool.hs Data/Char.hs Data/Complex.hs \ @@ -41,6 +41,7 @@ SRCS = \ Text/ParserCombinators/ReadP.hs Data/Version.hs \ Unsafe/Coerce.hs \ WCsubst.c dirUtils.c \ + GHC/IO/Device.hs \ System/Posix/Types.hs System/Posix/Internals.hs \ # Data/String.hs diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs index c4bb446..26a8a5b 100644 --- a/System/Posix/Internals.hs +++ b/System/Posix/Internals.hs @@ -56,6 +56,7 @@ import GHC.IO.Device import Hugs.Prelude (IOException(..), IOErrorType(..)) import Hugs.IO (IOMode(..)) #elif __NHC__ +import GHC.IO.Device -- yes, I know, but its portable, really! import System.IO import Control.Exception import DIOError diff --git a/include/Nhc98BaseConfig.h b/include/Nhc98BaseConfig.h index 5b6e23e..866e035 100644 --- a/include/Nhc98BaseConfig.h +++ b/include/Nhc98BaseConfig.h @@ -42,3 +42,4 @@ #define CONST_O_BINARY 0 #define READDIR_ERRNO_EOF 0 +#define INLINE /* to avoid inlining... */