From 72b08051834f48e51407e7cebe8719cc5b6555a3 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 15 Aug 2018 02:15:52 +0000 Subject: 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. --- test-getsubopt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test-getsubopt.c') diff --git a/test-getsubopt.c b/test-getsubopt.c index afcc5599..752c1cde 100644 --- a/test-getsubopt.c +++ b/test-getsubopt.c @@ -1,4 +1,4 @@ -/* $Id: test-getsubopt.c,v 1.4 2015/10/06 18:32:20 schwarze Exp $ */ +/* $Id: test-getsubopt.c,v 1.5 2018/08/15 02:15:52 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -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 +/* + * 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 + int main(void) { -- cgit v1.2.3-56-ge451