{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module System.PosixCompat.Types (
#ifdef mingw32_HOST_OS
module AllPosixTypesButFileID
, FileID
, UserID
, GroupID
, LinkCount
#else
module System.Posix.Types
#endif
) where
#ifdef mingw32_HOST_OS
import System.Posix.Types as AllPosixTypesButFileID hiding (FileID)
import Data.Word (Word32, Word64)
newtype FileID = FileID Word64
deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)
instance Show FileID where show (FileID x) = show x
instance Read FileID where readsPrec i s = [ (FileID x, s')
| (x,s') <- readsPrec i s]
newtype UserID = UserID Word32
deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)
instance Show UserID where show (UserID x) = show x
instance Read UserID where readsPrec i s = [ (UserID x, s')
| (x,s') <- readsPrec i s]
newtype GroupID = GroupID Word32
deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)
instance Show GroupID where show (GroupID x) = show x
instance Read GroupID where readsPrec i s = [ (GroupID x, s')
| (x,s') <- readsPrec i s]
newtype LinkCount = LinkCount Word32
deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)
instance Show LinkCount where show (LinkCount x) = show x
instance Read LinkCount where readsPrec i s = [ (LinkCount x, s')
| (x,s') <- readsPrec i s]
#else
import System.Posix.Types
#endif