X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Debug%2FTrace.hs;h=84de4d6b1ba96bcaec94ea24edaa0ccc658b0fc0;hb=b1f2e321ceac8fcfc1f0756e2f5c2585fbd00b3c;hp=7c9295f0ee848e9ce1cf38db9292d473c470da2e;hpb=99a329d9b272925dcdf474ce2369e9421b51e51c;p=ghc-base.git diff --git a/Debug/Trace.hs b/Debug/Trace.hs index 7c9295f..84de4d6 100644 --- a/Debug/Trace.hs +++ b/Debug/Trace.hs @@ -22,20 +22,19 @@ import Prelude import System.IO.Unsafe #ifdef __GLASGOW_HASKELL__ -#ifdef mingw32_HOST_OS import Foreign.C.String -#endif +#else +import System.IO (hPutStrLn,stderr) #endif -- | 'putTraceMsg' function outputs the trace message from IO monad. --- Usually the output stream is 'stderr' but if the function is called +-- Usually the output stream is 'System.IO.stderr' but if the function is called -- from Windows GUI application then the output will be directed to the Windows -- debug console. putTraceMsg :: String -> IO () putTraceMsg msg = do #ifndef __GLASGOW_HASKELL__ - hPutStr handle msg - hPutChar handle '\n' + hPutStrLn stderr msg #else withCString "%s\n" $ \cfmt -> withCString msg $ \cmsg ->