#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
{-# LANGUAGE ForeignFunctionInterface #-}
#endif
module Hint.CompatPlatform (
getPID
) where
import Control.Applicative
import Prelude
#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
import Data.Word
#else
import System.Posix.Process
#endif
getPID :: IO Int
#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
foreign import stdcall unsafe "winbase.h GetCurrentProcessId"
c_GetCurrentProcessId :: IO Word32
getPID = fromIntegral <$> c_GetCurrentProcessId
#else
getPID :: IO Int
getPID = ProcessID -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (ProcessID -> Int) -> IO ProcessID -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO ProcessID
getProcessID
#endif