[project @ 2005-01-31 13:52:26 by malcolm]
[haskell-directory.git] / Debug / Trace.hs
index 7c9295f..3e369f5 100644 (file)
@@ -22,9 +22,9 @@ 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.
@@ -34,8 +34,7 @@ import Foreign.C.String
 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 ->