[commit: ghc] master: Define CTYPE for more Posix types (6c7760b)

git at git.haskell.org git at git.haskell.org
Sat Jan 30 20:10:53 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6c7760b26133a0490f613895a37ff67045249fc8/ghc

>---------------------------------------------------------------

commit 6c7760b26133a0490f613895a37ff67045249fc8
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Jan 30 18:50:17 2016 +0100

    Define CTYPE for more Posix types
    
    See also b9f636b3aa962154c1b1515a3acecfbe9071b308 for explaination,
    as `unix` is slowly migrating to make more use of CApiFFI we need
    more accurately annotated CTYPES.


>---------------------------------------------------------------

6c7760b26133a0490f613895a37ff67045249fc8
 libraries/base/System/Posix/Internals.hs | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs
index 1074a2c..ceac5ff 100644
--- a/libraries/base/System/Posix/Internals.hs
+++ b/libraries/base/System/Posix/Internals.hs
@@ -62,18 +62,18 @@ puts s = withCAStringLen (s ++ "\n") $ \(p, len) -> do
 -- ---------------------------------------------------------------------------
 -- Types
 
-type CFLock     = ()
+data {-# CTYPE "struct flock" #-} CFLock
 data {-# CTYPE "struct group" #-} CGroup
-type CLconv     = ()
-type CPasswd    = ()
-type CSigaction = ()
+data {-# CTYPE "struct lconv" #-} CLconv
+data {-# CTYPE "struct passwd" #-} CPasswd
+data {-# CTYPE "struct sigaction" #-} CSigaction
 data {-# CTYPE "sigset_t" #-} CSigset
-type CStat      = ()
-type CTermios   = ()
-type CTm        = ()
-type CTms       = ()
-type CUtimbuf   = ()
-type CUtsname   = ()
+data {-# CTYPE "struct stat" #-}  CStat
+data {-# CTYPE "struct termios" #-} CTermios
+data {-# CTYPE "struct tm" #-} CTm
+data {-# CTYPE "struct tms" #-} CTms
+data {-# CTYPE "struct utimbuf" #-} CUtimbuf
+data {-# CTYPE "struct utsname" #-} CUtsname
 
 type FD = CInt
 



More information about the ghc-commits mailing list