From: Ben.Lippmeier@anu.edu.au Date: Sun, 30 Aug 2009 13:00:28 +0000 (+0000) Subject: Fix unicode conversion for MSB architectures X-Git-Tag: ghc-darcs-git-switchover~320 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=393e2611243321bea536e4b703ab88d8cf3b6a64;p=ghc-base.git Fix unicode conversion for MSB architectures This fixes the SPARC/Solaris build. --- diff --git a/GHC/IO/Encoding/Iconv.hs b/GHC/IO/Encoding/Iconv.hs index 554c053..cbcc5b9 100644 --- a/GHC/IO/Encoding/Iconv.hs +++ b/GHC/IO/Encoding/Iconv.hs @@ -25,6 +25,7 @@ module GHC.IO.Encoding.Iconv ( #endif ) where +#include "MachDeps.h" #include "HsBaseConfig.h" #if !defined(mingw32_HOST_OS) @@ -51,8 +52,8 @@ iconv_trace :: String -> IO () iconv_trace s = puts s puts :: String -> IO () -puts s = do withCStringLen (s++"\n") $ \(p,len) -> - c_write 1 p (fromIntegral len) +puts s = do withCStringLen (s++"\n") $ \(p, len) -> + c_write 1 (castPtr p) (fromIntegral len) return () #else @@ -174,6 +175,7 @@ iconvRecode iconv_t input@Buffer{ bufRaw=iraw, bufL=ir, bufR=iw, bufSize=_ } iscale output@Buffer{ bufRaw=oraw, bufL=_, bufR=ow, bufSize=os } oscale = do + iconv_trace ("haskelChar=" ++ show haskellChar) iconv_trace ("iconvRecode before, input=" ++ show (summaryBuffer input)) iconv_trace ("iconvRecode before, output=" ++ show (summaryBuffer output)) withRawBuffer iraw $ \ piraw -> do