From 0a8a643228f49157b4c348d2d224231efff18077 Mon Sep 17 00:00:00 2001
From: Ross Paterson <ross@soi.city.ac.uk>
Date: Tue, 24 Jul 2007 11:38:52 +0000
Subject: [PATCH] Hugs only: avoid dependency cycle

---
 Foreign/C/Error.hs        | 3 +++
 System/Posix/Internals.hs | 7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Foreign/C/Error.hs b/Foreign/C/Error.hs
index ac26141a..dc450f3c 100644
--- a/Foreign/C/Error.hs
+++ b/Foreign/C/Error.hs
@@ -118,6 +118,9 @@ import Data.Maybe
 import GHC.IOBase
 import GHC.Num
 import GHC.Base
+#elif __HUGS__
+import Hugs.Prelude		( Handle, IOError, ioError )
+import System.IO.Unsafe		( unsafePerformIO )
 #else
 import System.IO		( Handle )
 import System.IO.Error		( IOError, ioError )
diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs
index e03c5ddb..23ded361 100644
--- a/System/Posix/Internals.hs
+++ b/System/Posix/Internals.hs
@@ -32,18 +32,19 @@ import Foreign.C
 import Data.Bits
 import Data.Maybe
 
-#ifdef __GLASGOW_HASKELL__
+#if __GLASGOW_HASKELL__
 import GHC.Base
 import GHC.Num
 import GHC.Real
 import GHC.IOBase
+#elif __HUGS__
+import Hugs.Prelude (IOException(..), IOErrorType(..))
+import Hugs.IO (IOMode(..))
 #else
 import System.IO
 #endif
 
 #ifdef __HUGS__
-import Hugs.Prelude (IOException(..), IOErrorType(..))
-
 {-# CFILES cbits/PrelIOUtils.c cbits/dirUtils.c cbits/consUtils.c #-}
 #endif
 
-- 
GitLab