summaryrefslogtreecommitdiff
path: root/src/Data/ByteString/Base32/Internal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/ByteString/Base32/Internal.hs')
-rw-r--r--src/Data/ByteString/Base32/Internal.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Data/ByteString/Base32/Internal.hs b/src/Data/ByteString/Base32/Internal.hs
index aa7c5b3..31f6e30 100644
--- a/src/Data/ByteString/Base32/Internal.hs
+++ b/src/Data/ByteString/Base32/Internal.hs
@@ -26,7 +26,9 @@ module Data.ByteString.Base32.Internal
26import Prelude hiding (catch) 26import Prelude hiding (catch)
27#endif 27#endif
28import Control.Exception hiding (mask) 28import Control.Exception hiding (mask)
29#ifdef VERSION_bits_extras
29import Data.Bits.Extras 30import Data.Bits.Extras
31#endif
30import Data.ByteString as BS 32import Data.ByteString as BS
31import Data.ByteString.Internal as BS 33import Data.ByteString.Internal as BS
32import Data.Word 34import Data.Word
@@ -46,11 +48,19 @@ type Word5 = Word8
46-- intrinsics 48-- intrinsics
47-- 49--
48toBE64' :: Word64 -> Word64 50toBE64' :: Word64 -> Word64
51#ifdef VERSION_bits_extras
49toBE64' = if getSystemEndianness == BigEndian then id else byteSwap 52toBE64' = if getSystemEndianness == BigEndian then id else byteSwap
53#else
54toBE64' = toBE64
55#endif
50{-# INLINE toBE64' #-} 56{-# INLINE toBE64' #-}
51 57
52toBE32' :: Word32 -> Word32 58toBE32' :: Word32 -> Word32
59#ifdef VERSION_bits_extras
53toBE32' = if getSystemEndianness == BigEndian then id else byteSwap 60toBE32' = if getSystemEndianness == BigEndian then id else byteSwap
61#else
62toBE32' = toBE32
63#endif
54{-# INLINE toBE32' #-} 64{-# INLINE toBE32' #-}
55 65
56fromBE32' :: Word32 -> Word32 66fromBE32' :: Word32 -> Word32