[project @ 2003-05-25 20:54:18 by stolz]
[ghc-hetmet.git] / ghc / compiler / main / SysTools.lhs
index 9c7ddce..d99ce5d 100644 (file)
@@ -92,7 +92,7 @@ import Directory      ( doesFileExist, removeFile )
 
 #ifndef mingw32_HOST_OS
 #if __GLASGOW_HASKELL__ > 504
-import qualified GHC.Posix
+import qualified System.Posix.Internals
 #else
 import qualified Posix
 #endif
@@ -418,7 +418,7 @@ initSysTools minusB_args
        }
 
 #if defined(mingw32_HOST_OS)
-foreign import stdcall unsafe "GetTempPathA" getTempPath :: Int -> CString -> IO Int32
+foreign import stdcall "GetTempPathA" unsafe getTempPath :: Int -> CString -> IO Int32
 #endif
 \end{code}
 
@@ -843,28 +843,24 @@ getExecDir = do let len = (2048::Int) -- plenty, PATH_MAX is 512 under Win32.
                                    return (Just (reverse (dropList "/bin/ghc.exe" (reverse (unDosifyPath s)))))
 
 
-foreign import stdcall unsafe "GetModuleFileNameA"
+foreign import stdcall "GetModuleFileNameA" unsafe
   getModuleFileName :: Ptr () -> CString -> Int -> IO Int32
 #else
 getExecDir :: IO (Maybe String) = do return Nothing
 #endif
 
 #ifdef mingw32_HOST_OS
-foreign import ccall unsafe "_getpid" getProcessID :: IO Int -- relies on Int == Int32 on Windows
+foreign import ccall "_getpid" unsafe getProcessID :: IO Int -- relies on Int == Int32 on Windows
 #elif __GLASGOW_HASKELL__ > 504
 getProcessID :: IO Int
-getProcessID = GHC.Posix.c_getpid >>= return . fromIntegral
+getProcessID = System.Posix.Internals.c_getpid >>= return . fromIntegral
 #else
 getProcessID :: IO Int
 getProcessID = Posix.getProcessID
 #endif
 
 quote :: String -> String
-#if defined(mingw32_HOST_OS)
 quote "" = ""
 quote s  = "\"" ++ s ++ "\""
-#else
-quote s = s
-#endif
 
 \end{code}