X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fcompat%2FCompat%2FDirectory.hs;h=ecd5a996857a00c294a9f8a8829140db70282c76;hb=153b9cb9b11e05c4edb1b6bc0a7b972660e41f70;hp=6a9f4dc1be4de488d24cda7a8a5514fd3bc40cd5;hpb=585d87f1d621a386e4cfdd14f8a3ac1eed2413d4;p=ghc-hetmet.git diff --git a/ghc/lib/compat/Compat/Directory.hs b/ghc/lib/compat/Compat/Directory.hs index 6a9f4dc..ecd5a99 100644 --- a/ghc/lib/compat/Compat/Directory.hs +++ b/ghc/lib/compat/Compat/Directory.hs @@ -21,12 +21,10 @@ module Compat.Directory ( createDirectoryIfMissing ) where -#if __GLASGOW_HASKELL__ < 603 -#include "config.h" -#endif +#include "../../includes/ghcconfig.h" import System.Environment (getEnv) -import System.FilePath +import System.Directory.Internals #if __GLASGOW_HASKELL__ > 600 import Control.Exception ( bracket ) import Control.Monad ( when ) @@ -37,7 +35,7 @@ import GHC.IOBase ( IOException(..) ) #else import System.IO ( try ) #endif -#if __GLASGOW_HASKELL__ && defined(mingw32_TARGET_OS) +#if __GLASGOW_HASKELL__ && defined(mingw32_HOST_OS) import Foreign.Ptr import Foreign.C #endif @@ -45,7 +43,7 @@ import System.Directory(doesFileExist, doesDirectoryExist, getPermissions, setPe getAppUserDataDirectory :: String -> IO FilePath getAppUserDataDirectory appName = do -#if __GLASGOW_HASKELL__ && defined(mingw32_TARGET_OS) +#if __GLASGOW_HASKELL__ && defined(mingw32_HOST_OS) allocaBytes long_path_size $ \pPath -> do r <- c_SHGetFolderPath nullPtr csidl_APPDATA nullPtr 0 pPath s <- peekCString pPath @@ -55,7 +53,7 @@ getAppUserDataDirectory appName = do return (path++'/':'.':appName) #endif -#if __GLASGOW_HASKELL__ && defined(mingw32_TARGET_OS) +#if __GLASGOW_HASKELL__ && defined(mingw32_HOST_OS) foreign import stdcall unsafe "SHGetFolderPathA" c_SHGetFolderPath :: Ptr () -> CInt @@ -103,7 +101,7 @@ findExecutable binary = do path <- getEnv "PATH" search (parseSearchPath path) where -#ifdef mingw32_TARGET_OS +#ifdef mingw32_HOST_OS fileName = binary `joinFileExt` "exe" #else fileName = binary