projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add missing extensions for Windows
[ghc-base.git]
/
System
/
Posix
/
Types.hs
diff --git
a/System/Posix/Types.hs
b/System/Posix/Types.hs
index
77ec354
..
676fead
100644
(file)
--- a/
System/Posix/Types.hs
+++ b/
System/Posix/Types.hs
@@
-1,4
+1,10
@@
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# LANGUAGE CPP
+ , NoImplicitPrelude
+ , MagicHash
+ , GeneralizedNewtypeDeriving
+ #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Types
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Types
@@
-13,8
+19,26
@@
-- @\<sys\/types.h>@ C header on a POSIX system.
--
-----------------------------------------------------------------------------
-- @\<sys\/types.h>@ C header on a POSIX system.
--
-----------------------------------------------------------------------------
-
-#include "config.h"
+#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 (
module System.Posix.Types (
@@
-34,7
+58,7
@@
module System.Posix.Types (
#if defined(HTYPE_PID_T)
CPid,
#endif
#if defined(HTYPE_PID_T)
CPid,
#endif
-#if defined(HTYPE_SIZE_T) || defined(HTYPE_SSIZE_T)
+#if defined(HTYPE_SSIZE_T)
CSsize,
#endif
CSsize,
#endif
@@
-84,28
+108,32
@@
module System.Posix.Types (
Limit
) where
Limit
) where
+#ifdef __NHC__
+import NHC.PosixTypes
+import Foreign.C
+#else
+
import Foreign
import Foreign.C
import Data.Typeable
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
#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
import Control.Monad
#endif
import GHC.Read
import GHC.Show
#else
import Control.Monad
#endif
-#include "Typeable.h"
#include "CTypes.h"
#if defined(HTYPE_DEV_T)
#include "CTypes.h"
#if defined(HTYPE_DEV_T)
-NUMERIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
+ARITHMETIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
#endif
#if defined(HTYPE_INO_T)
INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
#endif
#if defined(HTYPE_INO_T)
INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
@@
-120,11
+148,7
@@
INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)
INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)
#endif
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
INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)
#endif
@@
-139,10
+163,10
@@
INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)
INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
#endif
#if defined(HTYPE_CC_T)
INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
#endif
#if defined(HTYPE_CC_T)
-NUMERIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
+ARITHMETIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
#endif
#if defined(HTYPE_SPEED_T)
#endif
#if defined(HTYPE_SPEED_T)
-NUMERIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
+ARITHMETIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
#endif
#if defined(HTYPE_TCFLAG_T)
INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
#endif
#if defined(HTYPE_TCFLAG_T)
INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
@@
-168,6
+192,8
@@
type UserID = CUid
type GroupID = CGid
#endif
type GroupID = CGid
#endif
+#endif /* !__NHC__ */
+
type ByteCount = CSize
type ClockTick = CClock
type EpochTime = CTime
type ByteCount = CSize
type ClockTick = CClock
type EpochTime = CTime
@@
-177,5
+203,5
@@
type FileMode = CMode
type ProcessID = CPid
type FileOffset = COff
type ProcessGroupID = CPid
type ProcessID = CPid
type FileOffset = COff
type ProcessGroupID = CPid
-type Limit = CLong
+type Limit = CLong