From 9865e73b90b0a83e8c33a747c5274250f9a1f812 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Thu, 19 Feb 2015 15:48:16 +0200 Subject: [PATCH] Remove NetBSD getopt dependency to unistd.h. - Remove the $NetBSD header as it wouldn't get updated and is wrong. --- src/extras/getopt.c | 8 ++++++-- src/extras/getopt.h | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/extras/getopt.c b/src/extras/getopt.c index 214cab7c..ba936f1c 100644 --- a/src/extras/getopt.c +++ b/src/extras/getopt.c @@ -1,5 +1,3 @@ -/* $NetBSD: getopt_long.c,v 1.4 2011/09/07 00:56:17 joerg Exp $ */ - /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. @@ -85,6 +83,12 @@ static const char illoptstring[] = "illegal option -- %s"; static const char *progname; +/* These are used to replace unistd.h include. */ +char *optarg = 0; +int optind = 0; +int opterr = 0; +int optopt = 0; +int optreset = 0; /* Replacement for warnx(3) for systems without it. */ static void xwarnx(const char *fmt, ...) { diff --git a/src/extras/getopt.h b/src/extras/getopt.h index fb20cfa0..5b1ddbf8 100644 --- a/src/extras/getopt.h +++ b/src/extras/getopt.h @@ -1,5 +1,3 @@ -/* $NetBSD: getopt.h,v 1.9 2014/09/11 21:48:34 jperkin Exp $ */ - /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. @@ -32,7 +30,9 @@ #ifndef _GETOPT_H_ #define _GETOPT_H_ -#include +/* These are used to replace unistd.h include. */ +extern char *optarg; +extern int optind, opterr, optopt, optreset; /* * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions