summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authortv <tv@NetBSD.org>2002-01-29 10:20:28 +0000
committertv <tv@NetBSD.org>2002-01-29 10:20:28 +0000
commita328e34106599ccb87ddb07217c33f1e844acfbf (patch)
tree6aff6262b618023ed68047c6655a436330f9380b /lib/libc/stdlib
parentff243397df2f10c378d41cd67c5ae754e7d52b8b (diff)
Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/getopt_long.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c
index 56417b0e3b6..cd179b0185c 100644
--- a/lib/libc/stdlib/getopt_long.c
+++ b/lib/libc/stdlib/getopt_long.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getopt_long.c,v 1.13 2001/11/04 13:57:31 lukem Exp $ */
+/* $NetBSD: getopt_long.c,v 1.14 2002/01/29 10:20:30 tv Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,18 +38,21 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getopt_long.c,v 1.13 2001/11/04 13:57:31 lukem Exp $");
+__RCSID("$NetBSD: getopt_long.c,v 1.14 2002/01/29 10:20:30 tv Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <assert.h>
#include <errno.h>
-#include <err.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
+#if HAVE_ERR_H || !HAVE_CONFIG_H
+#include <err.h>
+#endif
+
#ifdef REPLACE_GETOPT
#ifdef __weak_alias
__weak_alias(getopt,_getopt)
@@ -59,6 +62,8 @@ int optind = 1; /* index into parent argv vector */
int optopt = '?'; /* character checked for validity */
int optreset; /* reset getopt */
char *optarg; /* argument associated with option */
+#elif HAVE_CONFIG_H
+static int optreset;
#endif
#ifdef __weak_alias