Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0d8a4ae5bd7188cf255e769edac612e91b604d87

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

commit 0d8a4ae5bd7188cf255e769edac612e91b604d87
Author: Ian Lynagh <[email protected]>
Date:   Thu Feb 16 00:48:21 2012 +0000

    Add CTYPE pragmas for GHC types

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

 GHC/Int.hs     |   10 +++++-----
 GHC/Stable.lhs |    2 +-
 GHC/Word.hs    |   12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/GHC/Int.hs b/GHC/Int.hs
index 7182cba..a2bcae5 100644
--- a/GHC/Int.hs
+++ b/GHC/Int.hs
@@ -50,7 +50,7 @@ import GHC.Float ()     -- for RealFrac methods
 -- Int8 is represented in the same way as Int. Operations may assume
 -- and must ensure that it holds only values from its logical range.
 
-data Int8 = I8# Int# deriving (Eq, Ord)
+data {-# CTYPE "HsInt8" #-} Int8 = I8# Int# deriving (Eq, Ord)
 -- ^ 8-bit signed integer type
 
 instance Show Int8 where
@@ -205,7 +205,7 @@ instance Bits Int8 where
 -- Int16 is represented in the same way as Int. Operations may assume
 -- and must ensure that it holds only values from its logical range.
 
-data Int16 = I16# Int# deriving (Eq, Ord)
+data {-# CTYPE "HsInt16" #-} Int16 = I16# Int# deriving (Eq, Ord)
 -- ^ 16-bit signed integer type
 
 instance Show Int16 where
@@ -365,7 +365,7 @@ instance Bits Int16 where
 -- from its logical range.
 #endif
 
-data Int32 = I32# Int# deriving (Eq, Ord)
+data {-# CTYPE "HsInt32" #-} Int32 = I32# Int# deriving (Eq, Ord)
 -- ^ 32-bit signed integer type
 
 instance Show Int32 where
@@ -536,7 +536,7 @@ instance Ix Int32 where
 
 #if WORD_SIZE_IN_BITS < 64
 
-data Int64 = I64# Int64#
+data {-# CTYPE "HsInt64" #-} Int64 = I64# Int64#
 -- ^ 64-bit signed integer type
 
 instance Eq Int64 where
@@ -702,7 +702,7 @@ a `iShiftRA64#` b | b >=# 64# = if a `ltInt64#` 
(intToInt64# 0#)
 -- Operations may assume and must ensure that it holds only values
 -- from its logical range.
 
-data Int64 = I64# Int# deriving (Eq, Ord)
+data {-# CTYPE "HsInt64" #-} Int64 = I64# Int# deriving (Eq, Ord)
 -- ^ 64-bit signed integer type
 
 instance Show Int64 where
diff --git a/GHC/Stable.lhs b/GHC/Stable.lhs
index a07b0aa..e660917 100644
--- a/GHC/Stable.lhs
+++ b/GHC/Stable.lhs
@@ -48,7 +48,7 @@ which can treat it as an opaque reference to a Haskell value.
 A value of type @StablePtr a@ is a stable pointer to a Haskell
 expression of type @a@.
 -}
-data StablePtr a = StablePtr (StablePtr# a)
+data {-# CTYPE "HsStablePtr" #-} StablePtr a = StablePtr (StablePtr# a)
 
 -- |
 -- Create a stable pointer referring to the given Haskell value.
diff --git a/GHC/Word.hs b/GHC/Word.hs
index 7f2e584..b61fb58 100644
--- a/GHC/Word.hs
+++ b/GHC/Word.hs
@@ -47,7 +47,7 @@ import GHC.Float ()     -- for RealFrac methods
 ------------------------------------------------------------------------
 
 -- |A 'Word' is an unsigned integral type, with the same size as 'Int'.
-data Word = W# Word# deriving (Eq, Ord)
+data {-# CTYPE "HsWord" #-} Word = W# Word# deriving (Eq, Ord)
 
 instance Show Word where
     showsPrec _ (W# w) = showWord w
@@ -181,7 +181,7 @@ instance Bits Word where
 -- Word8 is represented in the same way as Word. Operations may assume
 -- and must ensure that it holds only values from its logical range.
 
-data Word8 = W8# Word# deriving (Eq, Ord)
+data {-# CTYPE "HsWord8" #-} Word8 = W8# Word# deriving (Eq, Ord)
 -- ^ 8-bit unsigned integer type
 
 instance Show Word8 where
@@ -322,7 +322,7 @@ instance Bits Word8 where
 -- Word16 is represented in the same way as Word. Operations may assume
 -- and must ensure that it holds only values from its logical range.
 
-data Word16 = W16# Word# deriving (Eq, Ord)
+data {-# CTYPE "HsWord16" #-} Word16 = W16# Word# deriving (Eq, Ord)
 -- ^ 16-bit unsigned integer type
 
 instance Show Word16 where
@@ -500,7 +500,7 @@ instance Bits Word16 where
 
 #endif
 
-data Word32 = W32# Word# deriving (Eq, Ord)
+data {-# CTYPE "HsWord32" #-} Word32 = W32# Word# deriving (Eq, Ord)
 -- ^ 32-bit unsigned integer type
 
 instance Num Word32 where
@@ -643,7 +643,7 @@ instance Read Word32 where
 
 #if WORD_SIZE_IN_BITS < 64
 
-data Word64 = W64# Word64#
+data {-# CTYPE "HsWord64" #-} Word64 = W64# Word64#
 -- ^ 64-bit unsigned integer type
 
 instance Eq Word64 where
@@ -761,7 +761,7 @@ a `shiftRL64#` b | b >=# 64#  = wordToWord64# (int2Word# 0#)
 -- Operations may assume and must ensure that it holds only values
 -- from its logical range.
 
-data Word64 = W64# Word# deriving (Eq, Ord)
+data {-# CTYPE "HsWord64" #-} Word64 = W64# Word# deriving (Eq, Ord)
 -- ^ 64-bit unsigned integer type
 
 instance Num Word64 where



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to