[project @ 2005-10-18 11:36:25 by simonmar]
authorsimonmar <unknown>
Tue, 18 Oct 2005 11:36:25 +0000 (11:36 +0000)
committersimonmar <unknown>
Tue, 18 Oct 2005 11:36:25 +0000 (11:36 +0000)
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
System/CPUTime.hsc
System/Directory.hs
System/Process/Internals.hs

index f56cf61..026aff5 100644 (file)
@@ -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
index 603afce..3309c2c 100644 (file)
@@ -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__ */
index a9d15f5..5ff3e77 100644 (file)
@@ -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)
index a7918b5..3348306 100644 (file)
@@ -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