summaryrefslogtreecommitdiff
path: root/libraries/base/Debug
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-12-15 20:11:50 +0000
committerIan Lynagh <igloo@earth.li>2011-12-15 23:59:31 +0000
commit95f330fa53df322d39592023661b010e649e8d24 (patch)
tree991eeb40411fcd5ddc585190575646f8740c3850 /libraries/base/Debug
parent7855f109d7b62579df3d45d2135369fe94091169 (diff)
downloadhaskell-95f330fa53df322d39592023661b010e649e8d24.tar.gz
Remove GHC.Exts.traceEventIO
Debug.Trace.traceEventIO should be used instead.
Diffstat (limited to 'libraries/base/Debug')
-rw-r--r--libraries/base/Debug/Trace.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs
index 17df6f36bc..4400c6cc0a 100644
--- a/libraries/base/Debug/Trace.hs
+++ b/libraries/base/Debug/Trace.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE Unsafe #-}
-{-# LANGUAGE CPP, ForeignFunctionInterface #-}
+{-# LANGUAGE CPP, ForeignFunctionInterface, MagicHash, UnboxedTuples #-}
-----------------------------------------------------------------------------
-- |
@@ -39,7 +39,10 @@ import Control.Monad
#ifdef __GLASGOW_HASKELL__
import Foreign.C.String
-import qualified GHC.Exts as GHC
+import GHC.Base
+import qualified GHC.Foreign
+import GHC.IO.Encoding
+import GHC.Ptr
import GHC.Stack
#else
import System.IO (hPutStrLn,stderr)
@@ -154,7 +157,9 @@ traceEvent msg expr = unsafeDupablePerformIO $ do
--
traceEventIO :: String -> IO ()
#ifdef __GLASGOW_HASKELL__
-traceEventIO = GHC.traceEventIO
+traceEventIO msg =
+ GHC.Foreign.withCString utf8 msg $ \(Ptr p) -> IO $ \s ->
+ case traceEvent# p s of s' -> (# s', () #)
#else
traceEventIO msg = (return $! length msg) >> return ()
#endif