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