Commit a4b7694c authored by Simon Marlow's avatar Simon Marlow
Browse files

adapt these to work on Windows

parent 09819a8e
{-# OPTIONS_GHC -cpp #-}
module Main where
import Control.Concurrent
#ifdef mingw32_HOST_OS
foreign import stdcall safe "Sleep" _sleepBlock :: Int -> IO ()
sleepBlock n = _sleepBlock (n*1000)
#else
foreign import ccall safe "sleep" sleepBlock :: Int -> IO ()
#endif
main :: IO ()
main = do
......
{-# OPTIONS_GHC -cpp #-}
module Main where
import Control.Concurrent
......@@ -7,7 +8,15 @@ haskellFun c = putStrLn ("Haskell: " ++ show c)
foreign export ccall "hFun" haskellFun :: Int -> IO ()
foreign import ccall safe "hFun" hFun :: Int -> IO ()
#ifdef mingw32_HOST_OS
foreign import stdcall safe "Sleep" _sleepBlock :: Int -> IO ()
sleepBlock n = _sleepBlock (n*1000)
#else
foreign import ccall safe "sleep" sleepBlock :: Int -> IO ()
#endif
main :: IO ()
main = do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment