From: Duncan C. <dun...@us...> - 2004-08-06 01:48:11
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/glib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv696/gtk/glib Modified Files: GError.chs Log Message: Compatability fixes for gtk-2.2 & 2.0 and for ghc-5.04.x. Also fix a typo in TreeModel.chs which caused a linker error in apps. Index: GError.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/GError.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GError.chs 24 Jul 2004 02:31:05 -0000 1.3 +++ GError.chs 6 Aug 2004 01:48:03 -0000 1.4 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) GError API -- @@ -86,13 +87,20 @@ import Control.Exception import Data.Dynamic -import Data.Typeable {# context lib="gtk" prefix ="gtk" #} -- | A GError consists of a domain, code and a human readable message. data GError = GError !GErrorDomain !GErrorCode !GErrorMessage +# if __GLASGOW_HASKELL__>=600 deriving Typeable +#else +{-# NOINLINE gerrorTypeRep #-} +gerrorTypeRep :: TypeRep +gerrorTypeRep = mkAppTy (mkTyCon "Graphics.UI.Gtk.GError.GError") [] +instance Typeable GError where + typeOf _ = gerrorTypeRep +#endif type GQuark = {#type GQuark #} @@ -198,7 +206,7 @@ -- | Use this if you need to explicitly throw a GError or re-throw an existing -- GError that you do not wish to handle. throwGError :: GError -> IO a -throwGError gerror = throwIO (DynException (toDyn gerror)) +throwGError gerror = evaluate (throwDyn gerror) -- | This will catch any GError exception. The handler function will receive the -- raw GError. This is probably only useful when you want to take some action |