projects
/
haskell-directory.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add System.Posix.Types to default nhc98 build
[haskell-directory.git]
/
Foreign
/
Storable.hs
diff --git
a/Foreign/Storable.hs
b/Foreign/Storable.hs
index
4c56b7a
..
c48746b
100644
(file)
--- a/
Foreign/Storable.hs
+++ b/
Foreign/Storable.hs
@@
-1,4
+1,4
@@
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Storable
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Storable
@@
-37,7
+37,7
@@
import NHC.FFI (Storable(..),Ptr,FunPtr,StablePtr
import Control.Monad ( liftM )
#include "MachDeps.h"
import Control.Monad ( liftM )
#include "MachDeps.h"
-#include "config.h"
+#include "HsBaseConfig.h"
#ifdef __GLASGOW_HASKELL__
import GHC.Storable
#ifdef __GLASGOW_HASKELL__
import GHC.Storable
@@
-54,12
+54,12
@@
import GHC.Base
#else
import Data.Int
import Data.Word
#else
import Data.Int
import Data.Word
-import Foreign.Ptr
import Foreign.StablePtr
#endif
#ifdef __HUGS__
import Hugs.Prelude
import Foreign.StablePtr
#endif
#ifdef __HUGS__
import Hugs.Prelude
+import Hugs.Ptr
import Hugs.Storable
#endif
import Hugs.Storable
#endif
@@
-81,7
+81,7
@@
All marshalling between Haskell and a foreign language ultimately
boils down to translating Haskell data structures into the binary
representation of a corresponding data structure of the foreign
language and vice versa. To code this marshalling in Haskell, it is
boils down to translating Haskell data structures into the binary
representation of a corresponding data structure of the foreign
language and vice versa. To code this marshalling in Haskell, it is
-necessary to manipulate primtive data types stored in unstructured
+necessary to manipulate primitive data types stored in unstructured
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',
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',
@@
-192,14
+192,14
@@
instance Storable (T) where { \
STORABLE(Char,SIZEOF_INT32,ALIGNMENT_INT32,
readWideCharOffPtr,writeWideCharOffPtr)
#elif defined(__HUGS__)
STORABLE(Char,SIZEOF_INT32,ALIGNMENT_INT32,
readWideCharOffPtr,writeWideCharOffPtr)
#elif defined(__HUGS__)
-STORABLE(Char,SIZEOF_CHAR,ALIGNMENT_HSCHAR,
+STORABLE(Char,SIZEOF_HSCHAR,ALIGNMENT_HSCHAR,
readCharOffPtr,writeCharOffPtr)
#endif
STORABLE(Int,SIZEOF_HSINT,ALIGNMENT_HSINT,
readIntOffPtr,writeIntOffPtr)
readCharOffPtr,writeCharOffPtr)
#endif
STORABLE(Int,SIZEOF_HSINT,ALIGNMENT_HSINT,
readIntOffPtr,writeIntOffPtr)
-#ifdef __GLASGOW_HASKELL__
+#ifndef __NHC__
STORABLE(Word,SIZEOF_HSWORD,ALIGNMENT_HSWORD,
readWordOffPtr,writeWordOffPtr)
#endif
STORABLE(Word,SIZEOF_HSWORD,ALIGNMENT_HSWORD,
readWordOffPtr,writeWordOffPtr)
#endif