From: Ian Lynagh Date: Wed, 4 Apr 2007 00:34:25 +0000 (+0000) Subject: Fix C/Haskell type mismatches X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=85174045bbcc05adb28447d423794d1f087da59e Fix C/Haskell type mismatches --- diff --git a/compat/cbits/rawSystem.c b/compat/cbits/rawSystem.c index 00b8c49..917594f 100644 --- a/compat/cbits/rawSystem.c +++ b/compat/cbits/rawSystem.c @@ -56,7 +56,7 @@ /* -------------------- WINDOWS VERSION --------------------- */ HsInt -rawSystem(HsAddr cmd) +rawSystem(char *cmd) { STARTUPINFO sInfo; PROCESS_INFORMATION pInfo; @@ -90,7 +90,7 @@ rawSystem(HsAddr cmd) /* -------------------- UNIX VERSION --------------------- */ HsInt -rawSystem(HsAddr cmd, HsAddr args) +rawSystem(char *cmd, char **args) { int pid; int wstat; diff --git a/compiler/ghci/ByteCodeGen.lhs b/compiler/ghci/ByteCodeGen.lhs index 0c668b9..72586ab 100644 --- a/compiler/ghci/ByteCodeGen.lhs +++ b/compiler/ghci/ByteCodeGen.lhs @@ -50,7 +50,7 @@ import Constants import Data.List ( intersperse, sortBy, zip4, zip6, partition ) import Foreign ( Ptr, castPtr, mallocBytes, pokeByteOff, Word8, withForeignPtr, castFunPtrToPtr ) -import Foreign.C ( CInt ) +import Foreign.C import Control.Exception ( throwDyn ) import GHC.Exts ( Int(..), ByteArray# ) @@ -1119,7 +1119,7 @@ pushAtom d p other (pprCoreExpr (deAnnotate (undefined, other))) foreign import ccall unsafe "memcpy" - memcpy :: Ptr a -> Ptr b -> CInt -> IO () + memcpy :: Ptr a -> Ptr b -> CSize -> IO () -- ----------------------------------------------------------------------------- diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index c5740d2..d34b0f3 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -2206,6 +2206,9 @@ sandboxIO thing = do foreign import "rts_evalStableIO" {- safe -} rts_evalStableIO :: StablePtr (IO a) -> Ptr (StablePtr a) -> IO CInt -- more informative than the C type! + +XXX the type of rts_evalStableIO no longer matches the above + -} diff --git a/includes/RtsExternal.h b/includes/RtsExternal.h index 3a3626b..6e23a9c 100644 --- a/includes/RtsExternal.h +++ b/includes/RtsExternal.h @@ -15,6 +15,10 @@ /* The standard FFI interface */ #include "HsFFI.h" +#ifdef HAVE_SYS_TYPES_H +#include +#endif + /* ----------------------------------------------------------------------------- Functions exported by the RTS for use in Stg code -------------------------------------------------------------------------- */ @@ -36,7 +40,7 @@ extern int genericRaise(int sig); extern int cmp_thread(StgPtr tso1, StgPtr tso2); extern int rts_getThreadId(StgPtr tso); extern int forkOS_createThread ( HsStablePtr entry ); -extern StgInt forkProcess(HsStablePtr *entry); +extern pid_t forkProcess(HsStablePtr *entry); extern HsBool rtsSupportsBoundThreads(void); extern StgInt newSpark (StgRegTable *reg, StgClosure *p); diff --git a/rts/Schedule.c b/rts/Schedule.c index fa8a651..3d87003 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2111,7 +2111,7 @@ scheduleDoGC (Capability *cap, Task *task USED_IF_THREADS, rtsBool force_major) * Singleton fork(). Do not copy any running threads. * ------------------------------------------------------------------------- */ -StgInt +pid_t forkProcess(HsStablePtr *entry #ifndef FORKPROCESS_PRIMOP_SUPPORTED STG_UNUSED