X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Debug%2FTrace.hs;h=c287a4dc5ac7418481d39833eaf2af43afa9ee4c;hb=a34fb5505b42a5f019d1fdf0dd586a5239400346;hp=e5905b1dcebd5339ff6eca513e84f866d34b041a;hpb=df757286ee0285330c925bf22c4fb8042a097f0a;p=ghc-base.git diff --git a/Debug/Trace.hs b/Debug/Trace.hs index e5905b1..c287a4d 100644 --- a/Debug/Trace.hs +++ b/Debug/Trace.hs @@ -12,17 +12,13 @@ -- ----------------------------------------------------------------------------- -#ifndef __HUGS__ -#include "config.h" -#endif - module Debug.Trace ( -- * Tracing -- ** Tracers -- | The tracer is a function that monitors the trace messages. fileTracer, -- :: Handle -> String -> IO () -#ifdef mingw32_TARGET_OS +#ifdef mingw32_HOST_OS winDebugTracer, -- :: String -> IO () #endif addTracer, -- :: String -> (String -> IO ()) -> IO () @@ -34,15 +30,13 @@ module Debug.Trace ( ) where import Prelude +import Data.IORef import System.IO.Unsafe import System.IO -#ifdef __GLASGOW_HASKELL__ -import GHC.IOBase -import GHC.Handle -#endif - +#ifdef mingw32_HOST_OS import Foreign.C.String +#endif {-# NOINLINE tracers #-} tracers :: IORef [(String, String -> IO ())] @@ -56,7 +50,7 @@ fileTracer handle msg = do hPutStr handle msg hPutChar handle '\n' -#ifdef mingw32_TARGET_OS +#ifdef mingw32_HOST_OS -- | A tracer function that outputs the message to the debuger (Windows only) winDebugTracer :: String -- ^ trace message -> IO ()