[commit: packages/binary] master: Move end of {-# RULES #-} to be more forgiving for CPP (fb4ea76)

git at git.haskell.org git at git.haskell.org
Mon Apr 4 11:05:21 UTC 2016


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

On branch  : master
Link       : http://git.haskell.org/packages/binary.git/commitdiff/fb4ea7609d1d47e95b14e55f5179deb4f8dcbc5f

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

commit fb4ea7609d1d47e95b14e55f5179deb4f8dcbc5f
Author: Lennart Kolmodin <kolmodin at gmail.com>
Date:   Mon Feb 8 22:09:16 2016 +0100

    Move end of {-# RULES #-} to be more forgiving for CPP
    
    This fixes #105. Older GHC versions + clang ran into trouble, which this commit
    fixes.


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

fb4ea7609d1d47e95b14e55f5179deb4f8dcbc5f
 binary.cabal                    | 2 +-
 changelog.md                    | 5 +++++
 src/Data/Binary/Get/Internal.hs | 4 +---
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/binary.cabal b/binary.cabal
index 5b01fba..b11a525 100644
--- a/binary.cabal
+++ b/binary.cabal
@@ -1,5 +1,5 @@
 name:            binary
-version:         0.8.2.0
+version:         0.8.2.1
 license:         BSD3
 license-file:    LICENSE
 author:          Lennart Kolmodin <kolmodin at gmail.com>
diff --git a/changelog.md b/changelog.md
index 669b5d7..2a4debd 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,11 @@
 binary
 ======
 
+binary-0.8.2.1
+--------------
+
+- Fix compilation error when using older GHC versions and clang. clang barfs on some of its CPP input (#105).
+
 binary-0.8.2.0
 --------------
 
diff --git a/src/Data/Binary/Get/Internal.hs b/src/Data/Binary/Get/Internal.hs
index 944a2ce..07d4177 100644
--- a/src/Data/Binary/Get/Internal.hs
+++ b/src/Data/Binary/Get/Internal.hs
@@ -398,9 +398,7 @@ readN !n f = ensureN n >> unsafeReadN n f
 {-# RULES
 
 "readN/readN merge" forall n m f g.
-  apG (readN n f) (readN m g) = readN (n+m) (\bs -> f bs $ g (B.unsafeDrop n bs))
-
- #-}
+  apG (readN n f) (readN m g) = readN (n+m) (\bs -> f bs $ g (B.unsafeDrop n bs)) #-}
 
 -- | Ensure that there are at least @n@ bytes available. If not, the
 -- computation will escape with 'Partial'.



More information about the ghc-commits mailing list