From: chak Date: Mon, 5 Feb 2001 11:49:20 +0000 (+0000) Subject: [project @ 2001-02-05 11:49:20 by chak] X-Git-Tag: Approximately_9120_patches~2749 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=1400a30193b6d976b383cc521d9d47b56f9e6616 [project @ 2001-02-05 11:49:20 by chak] Somewhere we lost the Storable instances of CFloat, CDouble and CLDouble & removed cruft from CTypes.h. --- diff --git a/ghc/lib/std/PrelStorable.lhs b/ghc/lib/std/PrelStorable.lhs index 343b36c..7bf23f5 100644 --- a/ghc/lib/std/PrelStorable.lhs +++ b/ghc/lib/std/PrelStorable.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelStorable.lhs,v 1.1 2001/01/11 17:25:57 simonmar Exp $ +% $Id: PrelStorable.lhs,v 1.2 2001/02/05 11:49:20 chak Exp $ % % (c) The FFI task force, 2000 % @@ -162,6 +162,9 @@ NSTORABLE(CLong) NSTORABLE(CULong) NSTORABLE(CLLong) NSTORABLE(CULLong) +NSTORABLE(CFloat) +NSTORABLE(CDouble) +NSTORABLE(CLDouble) NSTORABLE(CPtrdiff) NSTORABLE(CSize) NSTORABLE(CWchar) diff --git a/ghc/lib/std/cbits/CTypes.h b/ghc/lib/std/cbits/CTypes.h index 00f9ba8..1d956b1 100644 --- a/ghc/lib/std/cbits/CTypes.h +++ b/ghc/lib/std/cbits/CTypes.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: CTypes.h,v 1.1 2001/01/11 17:25:58 simonmar Exp $ + * $Id: CTypes.h,v 1.2 2001/02/05 11:49:20 chak Exp $ * * Dirty CPP hackery for CTypes/CTypesISO * @@ -62,13 +62,6 @@ C = mkTyCon S ; \ instance Typeable T where { \ typeOf _ = mkAppTy C [] } -#define INSTANCE_STORABLE(T) \ -instance Storable T where { \ - sizeOf (T x) = sizeOf x ; \ - alignment (T x) = alignment x ; \ - peekElemOff a i = liftM T (peekElemOff a i) ; \ - pokeElemOff a i (T x) = pokeElemOff a i x } - #define INSTANCE_BOUNDED(T) \ instance Bounded T where { \ minBound = T minBound ; \ @@ -240,13 +233,6 @@ instance Num T where { \ fromInteger = unsafeCoerce# (fromInteger :: Integer -> B); \ fromInt = unsafeCoerce# (fromInt :: Int -> B) } -#define INSTANCE_STORABLE(T,B) \ -instance Storable T where { \ - sizeOf = unsafeCoerce# (sizeOf :: B -> Int); \ - alignment = unsafeCoerce# (alignment :: B -> Int); \ - peekElemOff = unsafeCoerce# (peekElemOff :: Ptr B -> Int -> IO B); \ - pokeElemOff = unsafeCoerce# (pokeElemOff :: Ptr B -> Int -> B -> IO B); } - #define INSTANCE_BOUNDED(T,B) \ instance Bounded T where { \ minBound = T minBound ; \