diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-15 15:04:25 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-15 15:04:25 +0000 |
commit | 21bf9df13cad0da20ecd9fadfa54cd16479238aa (patch) | |
tree | 463a70a01e82f731fa31d60023778d078a0d7269 | |
parent | 6d2c28acaa0c11841ca57ffe2b07e34c91cdea9e (diff) | |
download | skalibs-21bf9df13cad0da20ecd9fadfa54cd16479238aa.tar.xz |
Better pipe2 detection on BSD systems
-rw-r--r-- | src/libstddjb/pipe_internal.c | 9 | ||||
-rw-r--r-- | src/sysdeps/trypipe2.c | 16 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/libstddjb/pipe_internal.c b/src/libstddjb/pipe_internal.c index a1e8a8f..48f182a 100644 --- a/src/libstddjb/pipe_internal.c +++ b/src/libstddjb/pipe_internal.c @@ -4,14 +4,7 @@ #ifdef SKALIBS_HASPIPE2 -#ifndef _NETBSD_SOURCE -#define _NETBSD_SOURCE -#endif - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - +#include <skalibs/nonposix.h> #include <unistd.h> #include <fcntl.h> #include <skalibs/djbunix.h> diff --git a/src/sysdeps/trypipe2.c b/src/sysdeps/trypipe2.c index 4e63182..0b8cb3c 100644 --- a/src/sysdeps/trypipe2.c +++ b/src/sysdeps/trypipe2.c @@ -1,11 +1,23 @@ /* ISC license. */ -#ifndef _NETBSD_SOURCE -#define _NETBSD_SOURCE +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ #endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _NETBSD_SOURCE +#define _NETBSD_SOURCE +#endif +#ifndef _INCOMPLETE_XOPEN_C063 +#define _INCOMPLETE_XOPEN_C063 +#endif #include <unistd.h> |