aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Terminal.hsc
diff options
context:
space:
mode:
authorGravatar Clemens Fruhwirth <clemens@endorphin.org>2007-10-16 14:38:46 +0000
committerGravatar Clemens Fruhwirth <clemens@endorphin.org>2007-10-16 14:38:46 +0000
commite72b7a399ea0cb735fdd2747174e11ca72672b26 (patch)
tree49a66e24529b7695593c2c72053aa0ec192f9a7f /System/Posix/Terminal.hsc
parent00557e661aa4cecba322802e696203f64508e04b (diff)
Also guard the foreign declaration of __hsunix(grant|unlock)pt by HAVE_PTSNAME
Diffstat (limited to 'System/Posix/Terminal.hsc')
-rw-r--r--System/Posix/Terminal.hsc8
1 files changed, 8 insertions, 0 deletions
diff --git a/System/Posix/Terminal.hsc b/System/Posix/Terminal.hsc
index 8717c7d..414d698 100644
--- a/System/Posix/Terminal.hsc
+++ b/System/Posix/Terminal.hsc
@@ -585,11 +585,19 @@ pushModule (Fd fd) name =
foreign import ccall unsafe "__hsunix_push_module"
c_push_module :: CInt -> CString -> IO CInt
+#ifdef HAVE_PTSNAME
foreign import ccall unsafe "__hsunix_grantpt"
c_grantpt :: CInt -> IO CInt
foreign import ccall unsafe "__hsunix_unlockpt"
c_unlockpt :: CInt -> IO CInt
+#else
+c_grantpt :: CInt -> IO CInt
+c_grantpt _ = return (fromIntegral 0)
+
+c_unlockpt :: CInt -> IO CInt
+c_unlockpt _ = return (fromIntegral 0)
+#endif /* HAVE_PTSNAME */
#endif /* !HAVE_OPENPTY */
-- -----------------------------------------------------------------------------