X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FMarshal%2FUtils.hs;h=5b21ca04e1696349a94ab7045e88f0fc541b8c70;hb=9fa9bc17072a58c0bae2cce4764d38677e96ac29;hp=3ae9e066dac6a9918f137886c6694785902ae91b;hpb=7f1f4e7a695c402ddd3a1dc2cc7114e649a78ebc;p=ghc-base.git diff --git a/Foreign/Marshal/Utils.hs b/Foreign/Marshal/Utils.hs index 3ae9e06..5b21ca0 100644 --- a/Foreign/Marshal/Utils.hs +++ b/Foreign/Marshal/Utils.hs @@ -1,15 +1,15 @@ {-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- --- +-- | -- Module : Foreign.Marshal.Utils -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/core/LICENSE) -- -- Maintainer : ffi@haskell.org --- Stability : experimental --- Portability : non-portable +-- Stability : provisional +-- Portability : portable -- --- $Id: Utils.hs,v 1.1 2001/06/28 14:15:03 simonmar Exp $ +-- $Id: Utils.hs,v 1.4 2002/04/24 16:31:44 simonmar Exp $ -- -- Utilities for primitive marshaling -- @@ -52,11 +52,11 @@ import Data.Maybe #ifdef __GLASGOW_HASKELL__ import Foreign.Ptr ( Ptr, nullPtr ) -import GHC.Storable ( Storable(poke,destruct) ) -import Foreign.C.TypesISO ( CSize ) -import Foreign.Marshal.Alloc ( malloc, alloca ) +import GHC.Storable ( Storable(poke) ) +import Foreign.C.TypesISO ( CSize ) +import Foreign.Marshal.Alloc ( malloc, alloca ) import GHC.IOBase -import GHC.Real ( fromIntegral ) +import GHC.Real ( fromIntegral ) import GHC.Num import GHC.Base #endif @@ -83,7 +83,6 @@ withObject val f = alloca $ \ptr -> do poke ptr val res <- f ptr - destruct ptr return res @@ -164,5 +163,5 @@ moveBytes dest src size = memmove dest src (fromIntegral size) -- basic C routines needed for memory copying -- -foreign import unsafe memcpy :: Ptr a -> Ptr a -> CSize -> IO () -foreign import unsafe memmove :: Ptr a -> Ptr a -> CSize -> IO () +foreign import ccall unsafe memcpy :: Ptr a -> Ptr a -> CSize -> IO () +foreign import ccall unsafe memmove :: Ptr a -> Ptr a -> CSize -> IO ()