{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module Foreign.Marshal.Utils.Compat (
module Base
, fillBytes
) where
import Foreign.Marshal.Utils as Base
#if !(MIN_VERSION_base(4,8,0))
import Data.Word (Word8)
import Foreign.C.Types
import Foreign.Ptr
import Prelude
fillBytes :: Ptr a -> Word8 -> Int -> IO ()
fillBytes dest char size = do
_ <- memset dest (fromIntegral char) (fromIntegral size)
return ()
foreign import ccall unsafe "string.h" memset :: Ptr a -> CInt -> CSize -> IO (Ptr a)
#endif