[commit: packages/primitive] ghc-head: Fix 64 bit compilation (hopefully) (e22a612)
git at git.haskell.org
git at git.haskell.org
Thu Sep 26 11:44:30 CEST 2013
Repository : ssh://git@git.haskell.org/primitive
On branch : ghc-head
Link : http://git.haskell.org/packages/primitive.git/commitdiff/e22a6121e9c5722ed1a56ded0e9d708777aa6be8
>---------------------------------------------------------------
commit e22a6121e9c5722ed1a56ded0e9d708777aa6be8
Author: Roman Leshchinskiy <rl at cse.unsw.edu.au>
Date: Fri Jan 27 19:17:59 2012 -0700
Fix 64 bit compilation (hopefully)
>---------------------------------------------------------------
e22a6121e9c5722ed1a56ded0e9d708777aa6be8
Data/Primitive/Internal/Operations.hs | 9 +++++----
Data/Primitive/MachDeps.hs | 11 +++++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/Data/Primitive/Internal/Operations.hs b/Data/Primitive/Internal/Operations.hs
index 622a3e5..0e53024 100644
--- a/Data/Primitive/Internal/Operations.hs
+++ b/Data/Primitive/Internal/Operations.hs
@@ -26,6 +26,7 @@ module Data.Primitive.Internal.Operations (
setAddrOffAddr#, setFloatOffAddr#, setDoubleOffAddr#, setWideCharOffAddr#
) where
+import Data.Primitive.MachDeps (Word64_#, Int64_#)
import GHC.Prim
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
@@ -35,7 +36,7 @@ foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
setWord32Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
- setWord64Array# :: MutableByteArray# s -> Int# -> Int# -> Word64# -> IO ()
+ setWord64Array# :: MutableByteArray# s -> Int# -> Int# -> Word64_# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
setWordArray# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
@@ -45,7 +46,7 @@ foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
setInt32Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
- setInt64Array# :: MutableByteArray# s -> Int# -> Int# -> Int64# -> IO ()
+ setInt64Array# :: MutableByteArray# s -> Int# -> Int# -> Int64_# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
setIntArray# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Ptr"
@@ -64,7 +65,7 @@ foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
setWord32OffAddr# :: Addr# -> Int# -> Int# -> Word# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
- setWord64OffAddr# :: Addr# -> Int# -> Int# -> Word64# -> IO ()
+ setWord64OffAddr# :: Addr# -> Int# -> Int# -> Word64_# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
setWordOffAddr# :: Addr# -> Int# -> Int# -> Word# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
@@ -74,7 +75,7 @@ foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
setInt32OffAddr# :: Addr# -> Int# -> Int# -> Int# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
- setInt64OffAddr# :: Addr# -> Int# -> Int# -> Int64# -> IO ()
+ setInt64OffAddr# :: Addr# -> Int# -> Int# -> Int64_# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
setIntOffAddr# :: Addr# -> Int# -> Int# -> Int# -> IO ()
foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Ptr"
diff --git a/Data/Primitive/MachDeps.hs b/Data/Primitive/MachDeps.hs
index 326be4a..c35e89c 100644
--- a/Data/Primitive/MachDeps.hs
+++ b/Data/Primitive/MachDeps.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE MagicHash #-}
-- |
-- Module : Data.Primitive.MachDeps
-- Copyright : (c) Roman Leshchinskiy 2009
@@ -13,6 +14,8 @@ module Data.Primitive.MachDeps where
#include "MachDeps.h"
+import GHC.Prim
+
sIZEOF_CHAR,
aLIGNMENT_CHAR,
@@ -110,3 +113,11 @@ aLIGNMENT_INT64 = ALIGNMENT_INT64
sIZEOF_WORD64 = SIZEOF_WORD64
aLIGNMENT_WORD64 = ALIGNMENT_WORD64
+#if WORD_SIZE_IN_BITS == 32
+type Word64_# = Word64#
+type Int64_# = Int64#
+#else
+type Word64_# = Word#
+type Int64_# = Int#
+#endif
+
More information about the ghc-commits
mailing list