[commit: bytestring] master: Drop support for ghc-6.4 and 6.6 (94565a0)
Ian Lynagh
igloo at earth.li
Sun Jun 19 18:39:04 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/bytestring
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/94565a007e371643782917be1ed56febd3f10c15
>---------------------------------------------------------------
commit 94565a007e371643782917be1ed56febd3f10c15
Author: Duncan Coutts <duncan at community.haskell.org>
Date: Tue May 17 11:25:32 2011 +0000
Drop support for ghc-6.4 and 6.6
>---------------------------------------------------------------
Data/ByteString.hs | 6 ------
Data/ByteString/Char8.hs | 7 ++-----
Data/ByteString/Internal.hs | 20 +++++++++-----------
bytestring.cabal | 9 +++------
4 files changed, 14 insertions(+), 28 deletions(-)
diff --git a/Data/ByteString.hs b/Data/ByteString.hs
index 8e8d23c..5970b21 100644
--- a/Data/ByteString.hs
+++ b/Data/ByteString.hs
@@ -990,15 +990,12 @@ break p ps = case findIndexOrEnd p ps of n -> (unsafeTake n ps, unsafeDrop n ps)
{-# INLINE [1] break #-}
#endif
-#if __GLASGOW_HASKELL__ >= 606
--- This RULE LHS is not allowed by ghc-6.4
{-# RULES
"ByteString specialise break (x==)" forall x.
break ((==) x) = breakByte x
"ByteString specialise break (==x)" forall x.
break (==x) = breakByte x
#-}
-#endif
-- INTERNAL:
@@ -1046,15 +1043,12 @@ spanByte c ps@(PS x s l) = inlinePerformIO $ withForeignPtr x $ \p ->
else go p (i+1)
{-# INLINE spanByte #-}
-#if __GLASGOW_HASKELL__ >= 606
--- This RULE LHS is not allowed by ghc-6.4
{-# RULES
"ByteString specialise span (x==)" forall x.
span ((==) x) = spanByte x
"ByteString specialise span (==x)" forall x.
span (==x) = spanByte x
#-}
-#endif
-- | 'spanEnd' behaves like 'span' but from the end of the 'ByteString'.
-- We have
diff --git a/Data/ByteString/Char8.hs b/Data/ByteString/Char8.hs
index a4fb461..283ab4a 100644
--- a/Data/ByteString/Char8.hs
+++ b/Data/ByteString/Char8.hs
@@ -270,7 +270,7 @@ import GHC.Ptr (Ptr(..))
import GHC.ST (ST(..))
#endif
-#if __GLASGOW_HASKELL__ >= 608
+#if MIN_VERSION_base(3,0,0)
import Data.String (IsString(..))
#endif
@@ -286,7 +286,7 @@ singleton :: Char -> ByteString
singleton = B.singleton . c2w
{-# INLINE singleton #-}
-#if __GLASGOW_HASKELL__ >= 608
+#if MIN_VERSION_base(3,0,0)
instance IsString ByteString where
fromString = pack
{-# INLINE fromString #-}
@@ -545,15 +545,12 @@ break f = B.break (f . w2c)
{-# INLINE [1] break #-}
#endif
-#if __GLASGOW_HASKELL__ >= 606
--- This RULE LHS is not allowed by ghc-6.4
{-# RULES
"ByteString specialise break (x==)" forall x.
break ((==) x) = breakChar x
"ByteString specialise break (==x)" forall x.
break (==x) = breakChar x
#-}
-#endif
-- INTERNAL:
diff --git a/Data/ByteString/Internal.hs b/Data/ByteString/Internal.hs
index 60028c5..9de4ad6 100644
--- a/Data/ByteString/Internal.hs
+++ b/Data/ByteString/Internal.hs
@@ -93,23 +93,21 @@ import GHC.IOBase (IO(IO),RawBuffer)
#endif
#if __GLASGOW_HASKELL__ >= 611
import GHC.IO (unsafeDupablePerformIO)
-#elif __GLASGOW_HASKELL__ >= 608
-import GHC.IOBase (unsafeDupablePerformIO)
#else
-import GHC.IOBase (unsafePerformIO)
+import GHC.IOBase (unsafeDupablePerformIO)
#endif
#else
import Data.Char (chr)
import System.IO.Unsafe (unsafePerformIO)
#endif
-#if __GLASGOW_HASKELL__ >= 605 && !defined(SLOW_FOREIGN_PTR)
+#ifdef __GLASGOW_HASKELL__
import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
#else
import Foreign.ForeignPtr (mallocForeignPtrBytes)
#endif
-#if __GLASGOW_HASKELL__>=605
+#ifdef __GLASGOW_HASKELL__
import GHC.ForeignPtr (ForeignPtr(ForeignPtr))
import GHC.Base (nullAddr#)
#else
@@ -190,7 +188,7 @@ packWith k str = unsafeCreate (length str) $ \p -> go p str
-- | The 0 pointer. Used to indicate the empty Bytestring.
nullForeignPtr :: ForeignPtr Word8
-#if __GLASGOW_HASKELL__>=605
+#ifdef __GLASGOW_HASKELL__
nullForeignPtr = ForeignPtr nullAddr# undefined --TODO: should ForeignPtrContents be strict?
#else
nullForeignPtr = unsafePerformIO $ newForeignPtr_ nullPtr
@@ -226,8 +224,8 @@ unsafeCreate :: Int -> (Ptr Word8 -> IO ()) -> ByteString
unsafeCreate l f = unsafeDupablePerformIO (create l f)
{-# INLINE unsafeCreate #-}
-#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ < 608
--- for Hugs
+#ifndef __GLASGOW_HASKELL__
+-- for Hugs, NHC etc
unsafeDupablePerformIO :: IO a -> a
unsafeDupablePerformIO = unsafePerformIO
#endif
@@ -269,11 +267,11 @@ createAndTrim' l f = do
memcpy p' (p `plusPtr` off) (fromIntegral l')
return $! (ps, res)
--- | Wrapper of mallocForeignPtrBytes with faster implementation
--- for GHC 6.5 builds newer than 06/06/06
+-- | Wrapper of 'mallocForeignPtrBytes' with faster implementation for GHC
+--
mallocByteString :: Int -> IO (ForeignPtr a)
mallocByteString l = do
-#if __GLASGOW_HASKELL__ >= 605 && !defined(SLOW_FOREIGN_PTR)
+#ifdef __GLASGOW_HASKELL__
mallocPlainForeignPtrBytes l
#else
mallocForeignPtrBytes l
diff --git a/bytestring.cabal b/bytestring.cabal
index 9177c90..4f0a4c4 100644
--- a/bytestring.cabal
+++ b/bytestring.cabal
@@ -21,13 +21,13 @@ Copyright: Copyright (c) Don Stewart 2005-2009,
Author: Don Stewart, Duncan Coutts
Maintainer: dons at galois.com, duncan at haskell.org
Homepage: http://www.cse.unsw.edu.au/~dons/fps.html
-Tested-With: GHC==6.12.0, GHC==6.10.4, GHC ==6.8.2, GHC==6.6.1, GHC==6.4.2
+Tested-With: GHC==7.0.2, GHC==6.12.3, GHC==6.10.4, GHC ==6.8.2
Build-Type: Simple
Cabal-Version: >= 1.2.3
extra-source-files: README TODO
library
- build-depends: base < 5
+ build-depends: base >= 3 && < 5
if impl(ghc >= 6.10)
build-depends: ghc-prim, base >= 4
@@ -58,8 +58,7 @@ library
-funbox-strict-fields
-fno-method-sharing
-fmax-simplifier-iterations10
- if impl(ghc >= 6.6)
- ghc-options: -fdicts-cheap
+ -fdicts-cheap
c-sources: cbits/fpstring.c
include-dirs: include
@@ -67,6 +66,4 @@ library
install-includes: fpstring.h
nhc98-options: -K4M -K3M
- if impl(ghc <= 6.4.2)
- cc-options: -DSLOW_FOREIGN_PTR
More information about the Cvs-libraries
mailing list