From: <as...@us...> - 2003-07-09 22:42:50
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/typehier In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/typehier Modified Files: TypeGenerator.hs Log Message: Make compile with GHC 6.00. There are two major changes in the FFI which made me separate everything that has to do with Foreign and Foreign.C into a new file called general/FFI.hs. The file UTFCForeign.hs is now obsolete as its string conversion functions are now in FFI.hs. The nullForeignPtr function is also located here. All files now import FFI instead of Foreign and UTFCForeign. The major changes are: newForeignPtr now takes a pointer to a C function as finalizer. Every destructor function is now defined differently depending on whether the new GHC is used or not. In particular there is now a function called free :: Ptr a -> IO () imported from the Foreign library. In addition to that I defined a function foreignFree which can be used as finalizer to a C data structure. It is equivalent to free if GHC version <=5.04 is used. The second change is that ForeignPtr are no longer accepted as arguments to foreign calls. This change is mainly reflected in c2hs, but also in some files which directly called functions. Index: TypeGenerator.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/typehier/TypeGenerator.hs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TypeGenerator.hs 19 Jan 2003 19:20:47 -0000 1.7 +++ TypeGenerator.hs 9 Jul 2003 22:42:46 -0000 1.8 @@ -148,13 +148,13 @@ indent 0.ss "--". indent 0.ss "module Hierarchy(". -- indent 1.ss "ObjectTag(..)". - foldl (.) id (map (\(n:_) -> ss ", ".indent 1.ss n.ss ", ".ss n. - ss "Class(..),".indent 1.ss "mk".ss n.ss ", un".ss n.sc ','. + foldl (.) id (map (\(n:_) -> ss ", ". + indent 1.ss n.ss "(".ss n.ss "), ".ss n.ss "Class(..),". + indent 1.ss "mk".ss n.ss ", un".ss n.sc ','. indent 1.ss "castTo".ss n) objs). indent 1.ss ") where". indent 0. - indent 0.ss "import Foreign (ForeignPtr, castForeignPtr, foreignPtrToPtr)". - indent 0.ss "import UTFCForeign (CULong)". + indent 0.ss "import FFI (ForeignPtr, castForeignPtr, foreignPtrToPtr,". ss " CULong)". indent 0.ss "import GType (typeInstanceIsA)". indent 0. indent 0.ss "{#context lib=\"gtk\" prefix=\"gtk\" #}". |