diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-08-15 02:15:52 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-08-15 02:15:52 +0000 |
commit | 48a10a64970575bdbe0d1c5342e0925b338be598 (patch) | |
tree | 05396a2b66e98040a95ee45656b95a0d483ed0f6 /test-getsubopt.c | |
parent | 9d71e0cbacf0681fd313f1e52974183828949490 (diff) | |
download | mandoc-48a10a64970575bdbe0d1c5342e0925b338be598.tar.gz |
Autodetect whether _GNU_SOURCE or _OPENBSD_SOURCE are needed; the
latter is a NetBSD idiosyncrasy reported by wiz@. Also take into
account that NetBSD declares getsubopt(3) in the wrong header.
Diffstat (limited to 'test-getsubopt.c')
-rw-r--r-- | test-getsubopt.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test-getsubopt.c b/test-getsubopt.c index 73347343..483a3839 100644 --- a/test-getsubopt.c +++ b/test-getsubopt.c @@ -15,12 +15,15 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if defined(__linux__) || defined(__MINT__) -#define _GNU_SOURCE /* getsubopt() */ -#endif - #include <stdlib.h> +/* + * NetBSD declares this function in the wrong header. + * No harm is done by allowing that, too: + * The only file using it, main.c, also includes unistd.h, anyway. + */ +#include <unistd.h> + int main(void) { |