summaryrefslogtreecommitdiffstats
path: root/test-getsubopt.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-15 02:15:52 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-15 02:15:52 +0000
commit48a10a64970575bdbe0d1c5342e0925b338be598 (patch)
tree05396a2b66e98040a95ee45656b95a0d483ed0f6 /test-getsubopt.c
parent9d71e0cbacf0681fd313f1e52974183828949490 (diff)
downloadmandoc-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.c11
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)
{