[commit: base] master: Convert come FFI bindings to use the capi calling convention (6874f4f)
Ian Lynagh
igloo at earth.li
Mon Nov 28 18:57:14 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/6874f4f7ab71960e44ccc5c270bc30dfc4e95169
>---------------------------------------------------------------
commit 6874f4f7ab71960e44ccc5c270bc30dfc4e95169
Author: Ian Lynagh <igloo at earth.li>
Date: Sat Nov 26 16:16:27 2011 +0000
Convert come FFI bindings to use the capi calling convention
>---------------------------------------------------------------
System/Posix/Internals.hs | 8 ++++----
include/HsBase.h | 26 --------------------------
2 files changed, 4 insertions(+), 30 deletions(-)
diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs
index 6436953..fe63dc5 100644
--- a/System/Posix/Internals.hs
+++ b/System/Posix/Internals.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE Trustworthy #-}
-{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface, CApiFFI #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
@@ -480,10 +480,10 @@ foreign import ccall unsafe "HsBase.h mkfifo"
foreign import ccall unsafe "HsBase.h pipe"
c_pipe :: Ptr CInt -> IO CInt
-foreign import ccall unsafe "HsBase.h __hscore_sigemptyset"
+foreign import capi unsafe "HsBase.h sigemptyset"
c_sigemptyset :: Ptr CSigset -> IO CInt
-foreign import ccall unsafe "HsBase.h __hscore_sigaddset"
+foreign import capi unsafe "HsBase.h sigaddset"
c_sigaddset :: Ptr CSigset -> CInt -> IO CInt
foreign import ccall unsafe "HsBase.h sigprocmask"
@@ -495,7 +495,7 @@ foreign import ccall unsafe "HsBase.h tcgetattr"
foreign import ccall unsafe "HsBase.h tcsetattr"
c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt
-foreign import ccall unsafe "HsBase.h __hscore_utime"
+foreign import capi unsafe "HsBase.h utime"
c_utime :: CString -> Ptr CUtimbuf -> IO CInt
foreign import ccall unsafe "HsBase.h waitpid"
diff --git a/include/HsBase.h b/include/HsBase.h
index d45ee99..fd619a8 100644
--- a/include/HsBase.h
+++ b/include/HsBase.h
@@ -181,32 +181,6 @@ INLINE int __hscore_s_issock(mode_t m) { return S_ISSOCK(m); }
#endif
#endif
-#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_WIN32)
-INLINE int
-__hscore_sigemptyset( sigset_t *set )
-{ return sigemptyset(set); }
-
-INLINE int
-__hscore_sigfillset( sigset_t *set )
-{ return sigfillset(set); }
-
-INLINE int
-__hscore_sigaddset( sigset_t * set, int s )
-{ return sigaddset(set,s); }
-
-INLINE int
-__hscore_sigdelset( sigset_t * set, int s )
-{ return sigdelset(set,s); }
-
-INLINE int
-__hscore_sigismember( sigset_t * set, int s )
-{ return sigismember(set,s); }
-
-INLINE int
-__hscore_utime( const char *file, const struct utimbuf *timep )
-{ return utime(file,timep); }
-#endif
-
INLINE void *
__hscore_memcpy_src_off( char *dst, char *src, int src_off, size_t sz )
{ return memcpy(dst, src+src_off, sz); }
More information about the Cvs-libraries
mailing list