Allow System.Posix.Internals to compile with nhc98 again.
authorMalcolm.Wallace@cs.york.ac.uk <unknown>
Mon, 15 Jun 2009 15:52:49 +0000 (15:52 +0000)
committerMalcolm.Wallace@cs.york.ac.uk <unknown>
Mon, 15 Jun 2009 15:52:49 +0000 (15:52 +0000)
Also affects GHC.IO.Device, which is not very GHC-specific at all.

GHC/IO/Device.hs
Makefile.nhc98
System/Posix/Internals.hs
include/Nhc98BaseConfig.h

index ab91bc0..5010fef 100644 (file)
@@ -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
index 8cffa95..1eb03ae 100644 (file)
@@ -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
index c4bb446..26a8a5b 100644 (file)
@@ -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
index 5b6e23e..866e035 100644 (file)
@@ -42,3 +42,4 @@
 #define CONST_O_BINARY         0
 #define READDIR_ERRNO_EOF      0
 
+#define INLINE /* to avoid inlining... */