Skip to content

Commit 999d3ae

Browse files
mmhathasufell
authored andcommitted
Removed unnecessary CPP
1 parent 113e568 commit 999d3ae

File tree

4 files changed

+17
-101
lines changed

4 files changed

+17
-101
lines changed

System/Posix/Directory.hsc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,14 @@ module System.Posix.Directory (
3030
-- * Reading directories
3131
DirStream,
3232
DirType( DtUnknown
33-
#ifdef CONST_DT_FIFO
3433
, DtFifo
35-
#endif
36-
#ifdef CONST_DT_CHR
3734
, DtChr
38-
#endif
39-
#ifdef CONST_DT_DIR
4035
, DtDir
41-
#endif
42-
#ifdef CONST_DT_BLK
4336
, DtBlk
44-
#endif
45-
#ifdef CONST_DT_REG
4637
, DtReg
47-
#endif
48-
#ifdef CONST_DT_LNK
4938
, DtLnk
50-
#endif
51-
#ifdef CONST_DT_SOCK
5239
, DtSock
53-
#endif
54-
#ifdef CONST_DT_WHT
5540
, DtWht
56-
#endif
5741
),
5842
openDirStream,
5943
readDirStream,

System/Posix/Directory/ByteString.hsc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,14 @@ module System.Posix.Directory.ByteString (
3030
-- * Reading directories
3131
DirStream,
3232
DirType( DtUnknown
33-
#ifdef CONST_DT_FIFO
3433
, DtFifo
35-
#endif
36-
#ifdef CONST_DT_CHR
3734
, DtChr
38-
#endif
39-
#ifdef CONST_DT_DIR
4035
, DtDir
41-
#endif
42-
#ifdef CONST_DT_BLK
4336
, DtBlk
44-
#endif
45-
#ifdef CONST_DT_REG
4637
, DtReg
47-
#endif
48-
#ifdef CONST_DT_LNK
4938
, DtLnk
50-
#endif
51-
#ifdef CONST_DT_SOCK
5239
, DtSock
53-
#endif
54-
#ifdef CONST_DT_WHT
5540
, DtWht
56-
#endif
5741
),
5842
openDirStream,
5943
readDirStream,

System/Posix/Directory/Common.hsc

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,14 @@ module System.Posix.Directory.Common (
2222
DirStream(..), DirEnt(..), CDir, CDirent, DirStreamOffset(..),
2323
DirType( DirType
2424
, DtUnknown
25-
#ifdef CONST_DT_FIFO
2625
, DtFifo
27-
#endif
28-
#ifdef CONST_DT_CHR
2926
, DtChr
30-
#endif
31-
#ifdef CONST_DT_DIR
3227
, DtDir
33-
#endif
34-
#ifdef CONST_DT_BLK
3528
, DtBlk
36-
#endif
37-
#ifdef CONST_DT_REG
3829
, DtReg
39-
#endif
40-
#ifdef CONST_DT_LNK
4130
, DtLnk
42-
#endif
43-
#ifdef CONST_DT_SOCK
4431
, DtSock
45-
#endif
46-
#ifdef CONST_DT_WHT
4732
, DtWht
48-
#endif
4933
),
5034
unsafeOpenDirStreamFd,
5135
readDirStreamWith,
@@ -97,51 +81,31 @@ data {-# CTYPE "struct dirent" #-} CDirent
9781
newtype DirType = DirType CChar
9882

9983
pattern DtUnknown :: DirType
100-
#ifdef CONST_DT_UNKNOWN
10184
pattern DtUnknown = DirType CONST_DT_UNKNOWN
102-
#else
103-
pattern DtUnknown = DirType 0
104-
#endif
10585

106-
#ifdef CONST_DT_FIFO
10786
pattern DtFifo :: DirType
108-
pattern DtFifo = DirType CONST_DT_FIFO
109-
#endif
87+
pattern DtFifo = DirType (CONST_DT_FIFO)
11088

111-
#ifdef CONST_DT_CHR
11289
pattern DtChr :: DirType
113-
pattern DtChr = DirType CONST_DT_CHR
114-
#endif
90+
pattern DtChr = DirType (CONST_DT_CHR)
11591

116-
#ifdef CONST_DT_DIR
11792
pattern DtDir :: DirType
118-
pattern DtDir = DirType CONST_DT_DIR
119-
#endif
93+
pattern DtDir = DirType (CONST_DT_DIR)
12094

121-
#ifdef CONST_DT_BLK
12295
pattern DtBlk :: DirType
123-
pattern DtBlk = DirType CONST_DT_BLK
124-
#endif
96+
pattern DtBlk = DirType (CONST_DT_BLK)
12597

126-
#ifdef CONST_DT_REG
12798
pattern DtReg :: DirType
128-
pattern DtReg = DirType CONST_DT_REG
129-
#endif
99+
pattern DtReg = DirType (CONST_DT_REG)
130100

131-
#ifdef CONST_DT_LNK
132101
pattern DtLnk :: DirType
133-
pattern DtLnk = DirType CONST_DT_LNK
134-
#endif
102+
pattern DtLnk = DirType (CONST_DT_LNK)
135103

136-
#ifdef CONST_DT_SOCK
137104
pattern DtSock :: DirType
138-
pattern DtSock = DirType CONST_DT_SOCK
139-
#endif
105+
pattern DtSock = DirType (CONST_DT_SOCK)
140106

141-
#ifdef CONST_DT_WHT
142107
pattern DtWht :: DirType
143-
pattern DtWht = DirType CONST_DT_WHT
144-
#endif
108+
pattern DtWht = DirType (CONST_DT_WHT)
145109

146110
-- | Call @fdopendir@ to obtain a directory stream for @fd@. @fd@ must not be
147111
-- otherwise used after this.

System/Posix/Directory/PosixPath.hsc

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,15 @@ module System.Posix.Directory.PosixPath (
2929
-- * Reading directories
3030
Common.DirStream,
3131
Common.DirType( DtUnknown
32-
#ifdef CONST_DT_FIFO
33-
, DtFifo
34-
#endif
35-
#ifdef CONST_DT_CHR
36-
, DtChr
37-
#endif
38-
#ifdef CONST_DT_DIR
39-
, DtDir
40-
#endif
41-
#ifdef CONST_DT_BLK
42-
, DtBlk
43-
#endif
44-
#ifdef CONST_DT_REG
45-
, DtReg
46-
#endif
47-
#ifdef CONST_DT_LNK
48-
, DtLnk
49-
#endif
50-
#ifdef CONST_DT_SOCK
51-
, DtSock
52-
#endif
53-
#ifdef CONST_DT_WHT
54-
, DtWht
55-
#endif
56-
),
32+
, DtFifo
33+
, DtChr
34+
, DtDir
35+
, DtBlk
36+
, DtReg
37+
, DtLnk
38+
, DtSock
39+
, DtWht
40+
),
5741
openDirStream,
5842
readDirStream,
5943
readDirStreamMaybe,

0 commit comments

Comments
 (0)