+{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module Mate.Strings (
import qualified Data.Map as M
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Internal as BI
+#ifdef DEBUG
import Text.Printf
+#endif
import Foreign.Ptr
import Foreign.Marshal.Alloc
BI.memset newstr 0 (fromIntegral $ strlen + 1)
copyBytes newstr arr strlen
let w32_ptr = fromIntegral $ ptrToIntPtr newstr
+#ifdef DEBUG
printf "new str ptr: 0x%08x (%s)@%d\n" w32_ptr (toString str) strlen
+#endif
return w32_ptr