From 2a5112bdcf1fb97caeb87c1ba76f49957d86d201 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 18 Oct 2005 11:36:25 +0000 Subject: [PATCH] [project @ 2005-10-18 11:36:25 by simonmar] Fixes to enable base to be compiled with -fasm on Windows: - a few stdcall/ccall mismatches - use GetTempPathA instead of GetTempPath (a couple of these) --- GHC/Conc.lhs | 2 +- System/CPUTime.hsc | 4 ++-- System/Directory.hs | 4 ++-- System/Process/Internals.hs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index f56cf61..026aff5 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -476,7 +476,7 @@ threadDelay time -- On Windows, we just make a safe call to 'Sleep' to implement threadDelay. #ifdef mingw32_HOST_OS -foreign import ccall safe "Sleep" c_Sleep :: CInt -> IO () +foreign import stdcall safe "Sleep" c_Sleep :: CInt -> IO () #endif foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool diff --git a/System/CPUTime.hsc b/System/CPUTime.hsc index 603afce..3309c2c 100644 --- a/System/CPUTime.hsc +++ b/System/CPUTime.hsc @@ -120,8 +120,8 @@ foreign import ccall unsafe times :: Ptr CTms -> IO CClock type FILETIME = () type HANDLE = () -- need proper Haskell names (initial lower-case character) -foreign import ccall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE) -foreign import ccall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt +foreign import stdcall unsafe "GetCurrentProcess" getCurrentProcess :: IO (Ptr HANDLE) +foreign import stdcall unsafe "GetProcessTimes" getProcessTimes :: Ptr HANDLE -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> Ptr FILETIME -> IO CInt #endif /* not _WIN32 */ #endif /* __GLASGOW_HASKELL__ */ diff --git a/System/Directory.hs b/System/Directory.hs index a9d15f5..5ff3e77 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -552,7 +552,7 @@ canonicalizePath fpath = peekCString pOutPath #if defined(mingw32_HOST_OS) -foreign import stdcall unsafe "GetFullPathName" +foreign import stdcall unsafe "GetFullPathNameA" c_GetFullPathName :: CString -> CInt -> CString @@ -983,7 +983,7 @@ foreign import ccall unsafe "__hscore_CSIDL_APPDATA" csidl_APPDATA :: CInt foreign import ccall unsafe "__hscore_CSIDL_WINDOWS" csidl_WINDOWS :: CInt foreign import ccall unsafe "__hscore_CSIDL_PERSONAL" csidl_PERSONAL :: CInt -foreign import stdcall unsafe "GetTempPath" c_GetTempPath :: CInt -> CString -> IO CInt +foreign import stdcall unsafe "GetTempPathA" c_GetTempPath :: CInt -> CString -> IO CInt raiseUnsupported loc = ioException (IOError Nothing UnsupportedOperation loc "unsupported operation" Nothing) diff --git a/System/Process/Internals.hs b/System/Process/Internals.hs index a7918b5..3348306 100644 --- a/System/Process/Internals.hs +++ b/System/Process/Internals.hs @@ -343,7 +343,7 @@ findCommandInterpreter = do Just cmd -> return cmd -foreign import stdcall unsafe "__hscore_get_osver" +foreign import ccall unsafe "__hscore_get_osver" c_get_osver :: IO CUInt #endif -- 1.7.10.4