[commit: directory] master: Remove nhc98-specific files and content (1e113d5)

Ian Lynagh igloo at earth.li
Fri Feb 15 23:56:52 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/directory

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/1e113d5086575f8582fba945c5dc8bdd2f69708c

>---------------------------------------------------------------

commit 1e113d5086575f8582fba945c5dc8bdd2f69708c
Author: Ian Lynagh <ian at well-typed.com>
Date:   Fri Feb 15 20:53:54 2013 +0000

    Remove nhc98-specific files and content

>---------------------------------------------------------------

 System/Directory.hs   |   22 ----------------------
 cbits/directory.c     |    2 +-
 include/HsDirectory.h |    6 +-----
 3 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/System/Directory.hs b/System/Directory.hs
index 097b177..dbce2ff 100644
--- a/System/Directory.hs
+++ b/System/Directory.hs
@@ -24,9 +24,7 @@ module System.Directory
 
     -- * Actions on directories
       createDirectory
-#ifndef __NHC__
     , createDirectoryIfMissing
-#endif
     , removeDirectory
     , removeDirectoryRecursive
     , renameDirectory
@@ -87,13 +85,6 @@ import System.IO.Error
 import Control.Monad           ( when, unless )
 import Control.Exception.Base as E
 
-#ifdef __NHC__
-import Directory -- hiding ( getDirectoryContents
-                 --        , doesDirectoryExist, doesFileExist
-                 --        , getModificationTime )
-import System (system)
-#endif /* __NHC__ */
-
 #ifdef __HUGS__
 import Hugs.Directory
 #endif /* __HUGS__ */
@@ -358,7 +349,6 @@ copyPermissions fromFPath toFPath
 
 #endif
 
-#ifndef __NHC__
 -- | @'createDirectoryIfMissing' parents dir@ creates a new directory 
 -- @dir@ if it doesn\'t exist. If the first argument is 'True'
 -- the function will also create all parent directories if they are missing.
@@ -413,7 +403,6 @@ createDirectoryIfMissing create_parents path0
 #endif
               ) `E.catch` ((\_ -> return ()) :: IOException -> IO ())
           | otherwise              -> throw e
-#endif  /* !__NHC__ */
 
 #if __GLASGOW_HASKELL__
 {- | @'removeDirectory' dir@ removes an existing directory /dir/.  The
@@ -674,12 +663,6 @@ copied to /new/, if possible.
 -}
 
 copyFile :: FilePath -> FilePath -> IO ()
-#ifdef __NHC__
-copyFile fromFPath toFPath =
-    do readFile fromFPath >>= writeFile toFPath
-       catchIOError (copyPermissions fromFPath toFPath)
-                    (\_ -> return ())
-#else
 copyFile fromFPath toFPath =
     copy `catchIOError` (\exc -> throw $ ioeSetLocation exc "copyFile")
     where copy = bracket (openBinaryFile fromFPath ReadMode) hClose $ \hFrom ->
@@ -701,7 +684,6 @@ copyFile fromFPath toFPath =
                           copyContents hFrom hTo buffer
 
           ignoreIOExceptions io = io `catchIOError` (\_ -> return ())
-#endif
 
 -- | Given path referring to a file or directory, returns a
 -- canonicalized path, with the intent that two paths referring
@@ -1171,12 +1153,8 @@ getTemporaryDirectory = do
   Win32.getTemporaryDirectory
 #else
   getEnv "TMPDIR"
-#if !__NHC__
     `catchIOError` \e -> if isDoesNotExistError e then return "/tmp"
                           else throw e
-#else
-    `catchIOError` (\ex -> return "/tmp")
-#endif
 #endif
 
 -- ToDo: This should be determined via autoconf (AC_EXEEXT)
diff --git a/cbits/directory.c b/cbits/directory.c
index 97e72d8..1a979ed 100644
--- a/cbits/directory.c
+++ b/cbits/directory.c
@@ -7,5 +7,5 @@
 #define INLINE
 #include "HsDirectory.h"
 
-#endif /* !__NHC__ */
+#endif
 
diff --git a/include/HsDirectory.h b/include/HsDirectory.h
index e997fde..eabaec1 100644
--- a/include/HsDirectory.h
+++ b/include/HsDirectory.h
@@ -9,17 +9,13 @@
 #ifndef __HSDIRECTORY_H__
 #define __HSDIRECTORY_H__
 
-#ifdef __NHC__
-#include "Nhc98BaseConfig.h"
-#else
-
 // On Solaris we have to make sure _FILE_OFFSET_BITS is defined 
 // before including <sys/stat.h> below, because that header
 // will try and define it if it isn't already.
 #include "HsFFI.h"
 
 #include "HsDirectoryConfig.h"
-#endif
+
 // Otherwise these clash with similar definitions from other packages:
 #undef PACKAGE_BUGREPORT
 #undef PACKAGE_NAME





More information about the ghc-commits mailing list