Wed Jan 24 16:48:43 PST 2007 Duncan Coutts <duncan@...>
* Delete lots of code for GHC-5.x since we now require GHC-6.0 minimum
Now that we require GHC-6.0 we can drop lots of conditional
compilation stuff like:
#if __GLASGOW_HASKELL__>=600
and in many cases we can simplify the code too. In particular
we can now use FinaliserPtr properly rather than pretending
it has an extra arg for compat with GHC 5.x
hunk ./glib/System/Glib/FFI.hs.pp 41
-# if __GLASGOW_HASKELL__<600
- -- ghc 6 exports unsafePerformIO from module Foreign
- -- provide it here for ghc 5
- unsafePerformIO,
-# endif
hunk ./glib/System/Glib/FFI.hs.pp 78
-#elif __GLASGOW_HASKELL__>=600
+#else
hunk ./glib/System/Glib/FFI.hs.pp 84
-#else
-nullForeignPtr :: ForeignPtr a
-nullForeignPtr = unsafePerformIO $ newForeignPtr nullPtr (return ())
hunk ./glib/System/Glib/GError.chs.pp 103
-# if __GLASGOW_HASKELL__>=600
hunk ./glib/System/Glib/GError.chs.pp 104
-#else
-{-# NOINLINE gerrorTypeRep #-}
-gerrorTypeRep :: TypeRep
-gerrorTypeRep = mkAppTy (mkTyCon "Graphics.UI.Gtk.GError.GError") []
-instance Typeable GError where
- typeOf _ = gerrorTypeRep
-#endif
hunk ./glib/System/Glib/GObject.chs.pp 107
-#if __GLASGOW_HASKELL__>=600
-
hunk ./glib/System/Glib/GObject.chs.pp 108
- object_unref' :: FinalizerPtr a
-
-objectUnref :: Ptr a -> FinalizerPtr a
-objectUnref _ = object_unref'
-
-#else
-
-foreign import ccall unsafe "g_object_unref"
- objectUnref :: Ptr a -> IO ()
-
-#endif
+ objectUnref :: FinalizerPtr a
hunk ./glib/System/Glib/GObject.chs.pp 124
- obj <- newForeignPtr objPtr (objectUnref objPtr)
+ obj <- newForeignPtr objPtr objectUnref
hunk ./glib/System/Glib/GObject.chs.pp 140
- obj <- newForeignPtr objPtr (objectUnref objPtr)
+ obj <- newForeignPtr objPtr objectUnref
hunk ./glib/System/Glib/UTFString.hs.pp 90
- gfree strPtr
- return str [_$_]
+ g_free strPtr
+ return str
hunk ./glib/System/Glib/UTFString.hs.pp 98
- gfree strPtr
+ g_free strPtr
hunk ./glib/System/Glib/UTFString.hs.pp 101
-#if __GLASGOW_HASKELL__>=600
-
hunk ./glib/System/Glib/UTFString.hs.pp 102
- gfree :: Ptr a -> IO ()
-
-#else
-
-foreign import ccall "g_free" unsafe
- gfree :: Ptr a -> IO ()
-
-#endif
+ g_free :: Ptr a -> IO ()
hunk ./glib/System/Glib/hsgclosure.c 32
-
-#if __GLASGOW_HASKELL__<600
-/* compatability for GHC 5.04 */
-/* The hs_free_stable_ptr function (which is part of the Haskell FFI spec) was
- * not added until GHC 6.0 so use the GHC-specific function instead: */
-#define hs_free_stable_ptr(a) freeStablePtr(a)
-/* GHC 5.04 does not have the rts_lock/rts_unlock functions,
- * From looking at the _stub.c files produced by GHC 5.04 it appears that we
- * do not need to replace these calls with anything else, so just define them
- * to expand to nothing: */
-#define rts_lock()
-#define rts_unlock()
-#endif
hunk ./gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp 110
- obj <- newForeignPtr objPtr (objectUnref objPtr)
+ obj <- newForeignPtr objPtr objectUnref
hunk ./gtk/Graphics/UI/Gtk/Gdk/Events.hsc 36
-#if __GLASGOW_HASKELL__<600
- eventSent,
- eventArea,
- eventRegion,
- eventCount,
- eventTime,
- eventX,
- eventY,
- eventIsHint,
- eventXRoot,
- eventYRoot,
- eventModifier,
- eventClick,
- eventButton,
- eventRelease,
- eventWithCapsLock,
- eventWithNumLock,
- eventWithScrollLock,
- eventKeyName,
- eventKeyChar,
- eventCrossingMode,
- eventNotifyType,
- eventInFocus,
- eventXParent,
- eventYParent,
- eventWidth,
- eventHeight,
- eventVisible,
- eventWindowMask,
- eventWindowState,
- eventInContact,
-#endif
hunk ./gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp 73
- region <- newForeignPtr rPtr (region_destroy rPtr)
+ region <- newForeignPtr rPtr region_destroy
hunk ./gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp 76
-#if __GLASGOW_HASKELL__>=600
-
hunk ./gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp 77
- region_destroy' :: FinalizerPtr Region
-
-region_destroy :: Ptr Region -> FinalizerPtr Region
-region_destroy _ = region_destroy'
-
-#else
-
-foreign import ccall unsafe "gdk_region_destroy"
- region_destroy :: Ptr Region -> IO ()
-
-#endif
+ region_destroy :: FinalizerPtr Region
hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 194
- liftM TextAttributes $ newForeignPtr ptr (text_attributes_unref ptr)
+ liftM TextAttributes $ newForeignPtr ptr text_attributes_unref
hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 196
-#if __GLASGOW_HASKELL__>=600
- [_$_]
hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 197
- text_attributes_unref' :: FinalizerPtr TextAttributes
- [_$_]
-text_attributes_unref :: Ptr TextAttributes -> FinalizerPtr TextAttributes
-text_attributes_unref _ = text_attributes_unref'
- [_$_]
-#else
- [_$_]
-foreign import ccall unsafe "gtk_text_attributes_unref"
- text_attributes_unref :: Ptr TextAttributes -> IO ()
- [_$_]
-#endif
+ text_attributes_unref :: FinalizerPtr TextAttributes
hunk ./gtk/Graphics/UI/Gtk/Pango/GlyphStorage.chs.pp 55
-#if __GLASGOW_HASKELL__>=600
hunk ./gtk/Graphics/UI/Gtk/Pango/GlyphStorage.chs.pp 56
-#else
-import Control.Exception (throw)
-throwIO :: Exception -> IO a
-throwIO = throw
-#endif
hunk ./gtk/Graphics/UI/Gtk/Pango/Layout.chs.pp 145
-#if __GLASGOW_HASKELL__>=600
hunk ./gtk/Graphics/UI/Gtk/Pango/Layout.chs.pp 146
-#else
-import Control.Exception (throw)
-throwIO :: Exception -> IO a
-throwIO = throw
-#endif[_^I_] [_$_]
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 134
-#if __GLASGOW_HASKELL__>=600
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 135
-#else
- liftM (PangoString correct cLen) $ newForeignPtr strPtr (free strPtr)
-#endif
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 146
- liftM GlyphStringRaw $ newForeignPtr llPtr (pango_glyph_string_free llPtr)
-
-
-#if __GLASGOW_HASKELL__>=600
+ liftM GlyphStringRaw $ newForeignPtr llPtr pango_glyph_string_free
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 149
- pango_glyph_string_free' :: FinalizerPtr GlyphStringRaw
-
-pango_glyph_string_free :: Ptr GlyphStringRaw -> FinalizerPtr GlyphStringRaw
-pango_glyph_string_free _ = pango_glyph_string_free'
-
-#else
-
-foreign import ccall unsafe "pango_glyph_string_free"
- pango_glyph_string_free :: Ptr GlyphStringRaw -> IO ()
-
-#endif
+ pango_glyph_string_free :: FinalizerPtr GlyphStringRaw
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 156
- liftM PangoItemRaw $ newForeignPtr llPtr (pango_item_free llPtr)
+ liftM PangoItemRaw $ newForeignPtr llPtr pango_item_free
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 161
-#if __GLASGOW_HASKELL__>=600
-
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 162
- pango_item_free' :: FinalizerPtr PangoItemRaw
-
-pango_item_free :: Ptr PangoItemRaw -> FinalizerPtr PangoItemRaw
-pango_item_free _ = pango_item_free'
-
-#else
-
-foreign import ccall unsafe "pango_item_free"
- pango_item_free :: Ptr PangoItemRaw -> IO ()
-
-#endif
+ pango_item_free :: FinalizerPtr PangoItemRaw
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 219
- liftM LayoutIterRaw $ newForeignPtr liPtr (layout_iter_free liPtr)
-
-#if __GLASGOW_HASKELL__>=600
+ liftM LayoutIterRaw $ newForeignPtr liPtr layout_iter_free
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 222
- layout_iter_free' :: FinalizerPtr LayoutIterRaw
-
-layout_iter_free :: Ptr LayoutIterRaw -> FinalizerPtr LayoutIterRaw
-layout_iter_free _ = layout_iter_free'
-
-#else
-
-foreign import ccall unsafe "pango_layout_iter_free"
- layout_iter_free :: Ptr LayoutIterRaw -> IO ()
-
-#endif
+ layout_iter_free :: FinalizerPtr LayoutIterRaw
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 232
- liftM LayoutLineRaw $ newForeignPtr llPtr (pango_layout_line_unref llPtr)
-
-
-#if __GLASGOW_HASKELL__>=600
+ liftM LayoutLineRaw $ newForeignPtr llPtr pango_layout_line_unref
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 235
- pango_layout_line_unref' :: FinalizerPtr LayoutLineRaw
-
-pango_layout_line_unref :: Ptr LayoutLineRaw -> FinalizerPtr LayoutLineRaw
-pango_layout_line_unref _ = pango_layout_line_unref'
-
-#else
-
-foreign import ccall unsafe "pango_layout_line_unref"
- pango_layout_line_unref :: Ptr LayoutLineRaw -> IO ()
-
-#endif
+ pango_layout_line_unref :: FinalizerPtr LayoutLineRaw
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 243
- liftM FontDescription $ newForeignPtr llPtr
- (pango_font_description_free llPtr)
-
-#if __GLASGOW_HASKELL__>=600
+ liftM FontDescription $ newForeignPtr llPtr pango_font_description_free
hunk ./gtk/Graphics/UI/Gtk/Pango/Types.chs.pp 246
- pango_font_description_free' :: FinalizerPtr FontDescription
-
-pango_font_description_free :: Ptr FontDescription -> [_$_]
- FinalizerPtr FontDescription
-pango_font_description_free _ = pango_font_description_free'
-
-#else
-
-foreign import ccall unsafe "pango_font_description_free"
- pango_font_description_free :: Ptr FontDescription -> IO ()
-
-#endif
+ pango_font_description_free :: FinalizerPtr FontDescription
hunk ./gtk/Graphics/UI/Gtk/TreeList/TreeRowReference.chs.pp 71
- newForeignPtr rowRefPtr (tree_row_reference_free rowRefPtr)
+ newForeignPtr rowRefPtr tree_row_reference_free
hunk ./gtk/Graphics/UI/Gtk/TreeList/TreeRowReference.chs.pp 93
-#if __GLASGOW_HASKELL__>=600
-
hunk ./gtk/Graphics/UI/Gtk/TreeList/TreeRowReference.chs.pp 94
- tree_row_reference_free' :: FinalizerPtr TreeRowReference
-
-tree_row_reference_free :: Ptr TreeRowReference -> FinalizerPtr TreeRowReference
-tree_row_reference_free _ = tree_row_reference_free'
-
-#else
-
-foreign import ccall unsafe "gtk_tree_row_reference_free"
- tree_row_reference_free :: Ptr TreeRowReference -> IO ()
+ tree_row_reference_free :: FinalizerPtr TreeRowReference
hunk ./gtk/Graphics/UI/Gtk/TreeList/TreeRowReference.chs.pp 96
-#endif
|