Skip to content

Commit

Permalink
Wrap GHCi support in #if darwin_HOST_OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed Apr 20, 2012
1 parent e889e28 commit 3a6d05e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion wxcore/src/haskell/Graphics/UI/WXCore/GHCiSupport.hs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.