summaryrefslogtreecommitdiff
path: root/include/getopt.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-03-23 14:46:13 +0000
committerNick Clifton <nickc@redhat.com>2005-03-23 14:46:13 +0000
commit5679ce4c6402b85440cb0171bf5e2bd4df726168 (patch)
treed85c517bedf6e03cfd8d8c35b8450e68d56d6139 /include/getopt.h
parent819648a4a9e065999dc9c041715d4af7d727710d (diff)
downloadgdb-5679ce4c6402b85440cb0171bf5e2bd4df726168.tar.gz
(getopt): Allow full prototype when builind under FreeBSD.
Diffstat (limited to 'include/getopt.h')
-rw-r--r--include/getopt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/getopt.h b/include/getopt.h
index a99a2290159..e5470e625fa 100644
--- a/include/getopt.h
+++ b/include/getopt.h
@@ -106,10 +106,12 @@ struct option
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if !HAVE_DECL_GETOPT
+#if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT) || defined (__FreeBSD__)
#if defined (__GNU_LIBRARY__) || defined (HAVE_DECL_GETOPT)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in unistd.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
+ errors, only prototype getopt for environments where we know that
+ there will ben o conflicts. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else
#ifndef __cplusplus