[commit: packages/bytestring] master: Fix misspelled WORDS_BIGENDIAN macro (4f52849)

git at git.haskell.org git at git.haskell.org
Sun May 15 21:16:51 UTC 2016


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

On branch  : master
Link       : http://git.haskell.org/packages/bytestring.git/commitdiff/4f52849a99753fab63d634769dd35a31f4d5a1b2

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

commit 4f52849a99753fab63d634769dd35a31f4d5a1b2
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Thu May 12 20:36:34 2016 +0200

    Fix misspelled WORDS_BIGENDIAN macro
    
    This was causing word{16,32,64}{le,be} primitives to break
    on big endian archs (such as `powerpc`/`powerpc64`) with
    serious consequences such as
    https://github.com/TomMD/pureMD5/issues/5


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

4f52849a99753fab63d634769dd35a31f4d5a1b2
 Data/ByteString/Builder/Prim/Binary.hs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Data/ByteString/Builder/Prim/Binary.hs b/Data/ByteString/Builder/Prim/Binary.hs
index 136a75a..af0c0bb 100644
--- a/Data/ByteString/Builder/Prim/Binary.hs
+++ b/Data/ByteString/Builder/Prim/Binary.hs
@@ -83,7 +83,7 @@ word8 = storableToF
 -- | Encoding 'Word16's in big endian format.
 {-# INLINE word16BE #-}
 word16BE :: FixedPrim Word16
-#ifdef WORD_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 word16BE = word16Host
 #else
 word16BE = fixedPrim 2 $ \w p -> do
@@ -94,7 +94,7 @@ word16BE = fixedPrim 2 $ \w p -> do
 -- | Encoding 'Word16's in little endian format.
 {-# INLINE word16LE #-}
 word16LE :: FixedPrim Word16
-#ifdef WORD_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 word16LE = fixedPrim 2 $ \w p -> do
     poke p               (fromIntegral (w)              :: Word8)
     poke (p `plusPtr` 1) (fromIntegral (shiftr_w16 w 8) :: Word8)
@@ -105,7 +105,7 @@ word16LE = word16Host
 -- | Encoding 'Word32's in big endian format.
 {-# INLINE word32BE #-}
 word32BE :: FixedPrim Word32
-#ifdef WORD_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 word32BE = word32Host
 #else
 word32BE = fixedPrim 4 $ \w p -> do
@@ -118,7 +118,7 @@ word32BE = fixedPrim 4 $ \w p -> do
 -- | Encoding 'Word32's in little endian format.
 {-# INLINE word32LE #-}
 word32LE :: FixedPrim Word32
-#ifdef WORD_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 word32LE = fixedPrim 4 $ \w p -> do
     poke p               (fromIntegral (w)               :: Word8)
     poke (p `plusPtr` 1) (fromIntegral (shiftr_w32 w  8) :: Word8)
@@ -134,7 +134,7 @@ word32LE = word32Host
 -- | Encoding 'Word64's in big endian format.
 {-# INLINE word64BE #-}
 word64BE :: FixedPrim Word64
-#ifdef WORD_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 word64BE = word64Host
 #else
 #if WORD_SIZE_IN_BITS < 64
@@ -170,7 +170,7 @@ word64BE = fixedPrim 8 $ \w p -> do
 -- | Encoding 'Word64's in little endian format.
 {-# INLINE word64LE #-}
 word64LE :: FixedPrim Word64
-#ifdef WORD_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 #if WORD_SIZE_IN_BITS < 64
 word64LE =
     fixedPrim 8 $ \w p -> do



More information about the ghc-commits mailing list