Skip to content

Commit 064a287

Browse files
Bodigrimhs-viktor
authored andcommitted
Clean up dead code
1 parent 5ca587a commit 064a287

File tree

4 files changed

+0
-53
lines changed

4 files changed

+0
-53
lines changed

System/Posix/Signals.hsc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -680,18 +680,6 @@ awaitSignal maybe_sigset = do
680680
foreign import ccall unsafe "sigsuspend"
681681
c_sigsuspend :: Ptr CSigset -> IO CInt
682682

683-
#if defined(darwin_HOST_OS) && __GLASGOW_HASKELL__ < 706
684-
-- see http://ghc.haskell.org/trac/ghc/ticket/7359#comment:3
685-
-- To be removed when support for GHC 7.4.x is dropped
686-
foreign import ccall unsafe "__hscore_sigdelset"
687-
c_sigdelset :: Ptr CSigset -> CInt -> IO CInt
688-
689-
foreign import ccall unsafe "__hscore_sigfillset"
690-
c_sigfillset :: Ptr CSigset -> IO CInt
691-
692-
foreign import ccall unsafe "__hscore_sigismember"
693-
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
694-
#else
695683
foreign import capi unsafe "signal.h sigdelset"
696684
c_sigdelset :: Ptr CSigset -> CInt -> IO CInt
697685

@@ -700,7 +688,6 @@ foreign import capi unsafe "signal.h sigfillset"
700688

701689
foreign import capi unsafe "signal.h sigismember"
702690
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
703-
#endif
704691

705692
foreign import ccall unsafe "sigpending"
706693
c_sigpending :: Ptr CSigset -> IO CInt

System/Posix/Terminal.hsc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,8 @@ getSlaveTerminalName (Fd fd) = do
130130
s <- throwErrnoIfNull "getSlaveTerminalName" (c_ptsname fd)
131131
peekFilePath s
132132

133-
# if __GLASGOW_HASKELL__ < 800
134-
-- see comment in cbits/HsUnix.c
135-
foreign import ccall unsafe "__hsunix_ptsname"
136-
c_ptsname :: CInt -> IO CString
137-
# else
138133
foreign import capi unsafe "HsUnix.h ptsname"
139134
c_ptsname :: CInt -> IO CString
140-
# endif
141135
#else
142136
getSlaveTerminalName _ =
143137
ioError (errnoToIOError "getSlaveTerminalName" eNOSYS Nothing Nothing)
@@ -190,20 +184,11 @@ foreign import ccall unsafe "__hsunix_push_module"
190184
c_push_module :: CInt -> CString -> IO CInt
191185

192186
#ifdef HAVE_PTSNAME
193-
# if __GLASGOW_HASKELL__ < 800
194-
-- see comment in cbits/HsUnix.c
195-
foreign import ccall unsafe "__hsunix_grantpt"
196-
c_grantpt :: CInt -> IO CInt
197-
198-
foreign import ccall unsafe "__hsunix_unlockpt"
199-
c_unlockpt :: CInt -> IO CInt
200-
# else
201187
foreign import capi unsafe "HsUnix.h grantpt"
202188
c_grantpt :: CInt -> IO CInt
203189

204190
foreign import capi unsafe "HsUnix.h unlockpt"
205191
c_unlockpt :: CInt -> IO CInt
206-
# endif
207192
#else
208193
c_grantpt :: CInt -> IO CInt
209194
c_grantpt _ = return (fromIntegral 0)

System/Posix/Terminal/ByteString.hsc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,8 @@ getSlaveTerminalName (Fd fd) = do
138138
s <- throwErrnoIfNull "getSlaveTerminalName" (c_ptsname fd)
139139
peekFilePath s
140140

141-
# if __GLASGOW_HASKELL__ < 800
142-
-- see comment in cbits/HsUnix.c
143-
foreign import ccall unsafe "__hsunix_ptsname"
144-
c_ptsname :: CInt -> IO CString
145-
# else
146141
foreign import capi unsafe "HsUnix.h ptsname"
147142
c_ptsname :: CInt -> IO CString
148-
# endif
149143
#else
150144
getSlaveTerminalName _ =
151145
ioError (errnoToIOError "getSlaveTerminalName" eNOSYS Nothing Nothing)
@@ -198,20 +192,11 @@ foreign import ccall unsafe "__hsunix_push_module"
198192
c_push_module :: CInt -> CString -> IO CInt
199193

200194
#if HAVE_PTSNAME
201-
# if __GLASGOW_HASKELL__ < 800
202-
-- see comment in cbits/HsUnix.c
203-
foreign import ccall unsafe "__hsunix_grantpt"
204-
c_grantpt :: CInt -> IO CInt
205-
206-
foreign import ccall unsafe "__hsunix_unlockpt"
207-
c_unlockpt :: CInt -> IO CInt
208-
# else
209195
foreign import capi unsafe "HsUnix.h grantpt"
210196
c_grantpt :: CInt -> IO CInt
211197

212198
foreign import capi unsafe "HsUnix.h unlockpt"
213199
c_unlockpt :: CInt -> IO CInt
214-
# endif
215200
#else
216201
c_grantpt :: CInt -> IO CInt
217202
c_grantpt _ = return (fromIntegral (0::Int))

cbits/HsUnix.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ void *__hsunix_rtldNext (void) {return RTLD_NEXT;}
1616
void *__hsunix_rtldDefault (void) {return RTLD_DEFAULT;}
1717
#endif
1818

19-
#if HAVE_PTSNAME && (__GLASGOW_HASKELL__ < 800)
20-
// On Linux (and others), <stdlib.h> needs to be included while
21-
// `_XOPEN_SOURCE` is already defined. However, GHCs before GHC 8.0
22-
// didn't do that yet for CApiFFI, so we need this workaround here.
23-
24-
char *__hsunix_ptsname(int fd) { return ptsname(fd); }
25-
int __hsunix_grantpt(int fd) { return grantpt(fd); }
26-
int __hsunix_unlockpt(int fd) { return unlockpt(fd); }
27-
#endif
28-
2919
// push a SVR4 STREAMS module; do nothing if STREAMS not available
3020
int __hsunix_push_module(int fd, const char *module)
3121
{

0 commit comments

Comments
 (0)