diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-31 00:01:18 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-31 00:19:53 +0100 |
commit | 2ddf4b2b7bf41f878bc7d8a1afa49126710f524c (patch) | |
tree | 5588e4cfd849d6c6bfc6efa4d7764b9a34e9b2e4 /cbits | |
parent | 2a49ad87b7b5d92bf62035d410c4bcde817d30a6 (diff) |
Avoid redundant prototypes for ptsname(3) et al
This is now possible since we now use `AC_USE_SYSTEM_EXTENSIONS`, which
indirectly enables _XOPEN_SOURCE
Diffstat (limited to 'cbits')
-rw-r--r-- | cbits/HsUnix.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c index e54bccf..09cfc9c 100644 --- a/cbits/HsUnix.c +++ b/cbits/HsUnix.c @@ -35,25 +35,22 @@ int __hsunix_getpwuid_r(uid_t uid, struct passwd *pw, char *buffer, #endif #ifdef HAVE_PTSNAME -// I cannot figure out how to make the definitions of the following -// functions visible in <stdlib.h> on Linux. But these definitions -// follow the POSIX specs, and everything links and runs. +// On Linux (and others), <stdlib.h> needs to be included while +// `_XOPEN_SOURCE` is already defined. However, GHCs before GHC 8.0 +// didn't do that yet for CApiFFI, so we need this workaround here. char *__hsunix_ptsname(int fd) { - extern char *ptsname(int); return ptsname(fd); } int __hsunix_grantpt(int fd) { - extern int grantpt(int); return grantpt(fd); } int __hsunix_unlockpt(int fd) { - extern int unlockpt(int); return unlockpt(fd); } #endif |