projects
/
haskell-directory.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2003-07-28 12:11:46 by malcolm]
[haskell-directory.git]
/
Foreign
/
Storable.hs
diff --git
a/Foreign/Storable.hs
b/Foreign/Storable.hs
index
c218fe8
..
78e2d4f
100644
(file)
--- a/
Foreign/Storable.hs
+++ b/
Foreign/Storable.hs
@@
-29,6
+29,11
@@
module Foreign.Storable
) where
) where
+#ifdef __NHC__
+import NHC.FFI (Storable(..),Ptr,FunPtr,StablePtr
+ ,Int8,Int16,Int32,Int64,Word8,Word16,Word32,Word64)
+#else
+
import Control.Monad ( liftM )
#include "MachDeps.h"
import Control.Monad ( liftM )
#include "MachDeps.h"
@@
-46,7
+51,15
@@
import GHC.Float
import GHC.Err
import GHC.IOBase
import GHC.Base
import GHC.Err
import GHC.IOBase
import GHC.Base
-#elif defined(__HUGS__)
+#else
+import Data.Int
+import Data.Word
+import Foreign.Ptr
+import Foreign.StablePtr
+#endif
+
+#ifdef __HUGS__
+import Hugs.Prelude
import Hugs.Storable
#endif
import Hugs.Storable
#endif
@@
-73,8
+86,8
@@
memory blocks. The class 'Storable' facilitates this manipulation on
all types for which it is instantiated, which are the standard basic
types of Haskell, the fixed size @Int@ types ('Int8', 'Int16',
'Int32', 'Int64'), the fixed size @Word@ types ('Word8', 'Word16',
all types for which it is instantiated, which are the standard basic
types of Haskell, the fixed size @Int@ types ('Int8', 'Int16',
'Int32', 'Int64'), the fixed size @Word@ types ('Word8', 'Word16',
-'Word32', 'Word64'), 'StablePtr', all types from "CTypes" and
-"CTypesISO", as well as 'Ptr'.
+'Word32', 'Word64'), 'StablePtr', all types from "Foreign.C.Types",
+as well as 'Ptr'.
Minimal complete definition: 'sizeOf', 'alignment', one of 'peek',
'peekElemOff' and 'peekByteOff', and one of 'poke', 'pokeElemOff' and
Minimal complete definition: 'sizeOf', 'alignment', one of 'peek',
'peekElemOff' and 'peekByteOff', and one of 'poke', 'pokeElemOff' and
@@
-229,3
+242,5
@@
STORABLE(Int32,SIZEOF_INT32,ALIGNMENT_INT32,
STORABLE(Int64,SIZEOF_INT64,ALIGNMENT_INT64,
readInt64OffPtr,writeInt64OffPtr)
STORABLE(Int64,SIZEOF_INT64,ALIGNMENT_INT64,
readInt64OffPtr,writeInt64OffPtr)
+
+#endif