X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FPosix%2FTypes.hs;h=bd286f4462cd25bb3aef6a8c9c975bb6173319da;hb=dc372329214c1e8ef32f1a20173c3e8cc6dc0572;hp=7c30a54e10abc9216cfb4e570f78ef9f9e546c67;hpb=40001ff06f1058c5b375f8b6c6c3dfd0471600ba;p=ghc-base.git diff --git a/System/Posix/Types.hs b/System/Posix/Types.hs index 7c30a54..bd286f4 100644 --- a/System/Posix/Types.hs +++ b/System/Posix/Types.hs @@ -1,4 +1,5 @@ -{-# OPTIONS -fno-implicit-prelude #-} +{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} ----------------------------------------------------------------------------- -- | -- Module : System.Posix.Types @@ -13,8 +14,26 @@ -- @\@ C header on a POSIX system. -- ----------------------------------------------------------------------------- - +#ifdef __NHC__ +#define HTYPE_DEV_T +#define HTYPE_INO_T +#define HTYPE_MODE_T +#define HTYPE_OFF_T +#define HTYPE_PID_T +#define HTYPE_SSIZE_T +#define HTYPE_GID_T +#define HTYPE_NLINK_T +#define HTYPE_UID_T +#define HTYPE_CC_T +#define HTYPE_SPEED_T +#define HTYPE_TCFLAG_T +#define HTYPE_RLIM_T +#define HTYPE_NLINK_T +#define HTYPE_UID_T +#define HTYPE_GID_T +#else #include "HsBaseConfig.h" +#endif module System.Posix.Types ( @@ -34,7 +53,7 @@ module System.Posix.Types ( #if defined(HTYPE_PID_T) CPid, #endif -#if defined(HTYPE_SIZE_T) || defined(HTYPE_SSIZE_T) +#if defined(HTYPE_SSIZE_T) CSsize, #endif @@ -84,17 +103,22 @@ module System.Posix.Types ( Limit ) where +#ifdef __NHC__ +import NHC.PosixTypes +import Foreign.C +#else + import Foreign import Foreign.C import Data.Typeable -import Data.Bits +-- import Data.Bits #ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.Enum import GHC.Num import GHC.Real -import GHC.Prim +-- import GHC.Prim import GHC.Read import GHC.Show #else @@ -119,11 +143,7 @@ INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T) INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T) #endif -#if defined(HTYPE_SIZE_T) -INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SIZE_T) -#endif - -#if defined(HTYPE_SSIZE_T) && !defined(HTYPE_SIZE_T) +#if defined(HTYPE_SSIZE_T) INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T) #endif @@ -167,6 +187,8 @@ type UserID = CUid type GroupID = CGid #endif +#endif /* !__NHC__ */ + type ByteCount = CSize type ClockTick = CClock type EpochTime = CTime @@ -176,5 +198,5 @@ type FileMode = CMode type ProcessID = CPid type FileOffset = COff type ProcessGroupID = CPid -type Limit = CLong +type Limit = CLong