Permalink
Browse files

Wrap GHCi support in #if darwin_HOST_OS.

  • Loading branch information...
1 parent e889e28 commit 3a6d05e4bcc7bfe9c71e62562632f3a78df18496 @HeinrichApfelmus HeinrichApfelmus committed Apr 20, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 wxcore/src/haskell/Graphics/UI/WXCore/GHCiSupport.hs
@@ -1,8 +1,10 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
module Graphics.UI.WXCore.GHCiSupport(enableGUI) where
-- GHCi support on MacOS X
-- TODO: preprocessor to make it conditional on the platform
+#if darwin_HOST_OS
+
import Data.Int
import Foreign
@@ -14,9 +16,17 @@ foreign import ccall "CPSEnableForegroundOperation" cpsEnableForegroundOperation
foreign import ccall "CPSSignalAppReady" cpsSignalAppReady :: Ptr ProcessSerialNumber -> IO ()
foreign import ccall "CPSSetFrontProcess" cpsSetFrontProcess :: Ptr ProcessSerialNumber -> IO ()
+enableGUI :: IO ()
enableGUI = alloca $ \psn -> do
getCurrentProcess psn
cgsDefaultConnection
cpsEnableForegroundOperation psn
cpsSignalAppReady psn
cpsSetFrontProcess psn
+
+#else
+
+enableGUI :: IO ()
+enableGUI = return ()
+
+#endif

0 comments on commit 3a6d05e

Please sign in to comment.