aboutsummaryrefslogtreecommitdiffstats
path: root/getopt.h
diff options
context:
space:
mode:
Diffstat (limited to 'getopt.h')
-rw-r--r--getopt.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/getopt.h b/getopt.h
index 5d4300fa..de027434 100644
--- a/getopt.h
+++ b/getopt.h
@@ -94,7 +94,14 @@ enum _argtype
};
#if __STDC__
+#if defined(__GNU_LIBRARY__)
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* not __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,