[project @ 2005-03-14 16:26:47 by simonmar]
[ghc-base.git] / Debug / Trace.hs
index 5bc7128..84de4d6 100644 (file)
@@ -23,17 +23,18 @@ import System.IO.Unsafe
 
 #ifdef __GLASGOW_HASKELL__
 import Foreign.C.String
+#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 ->