1998-03-11 Raja R Harinath <harinath@cs.umn.edu>
- * getopt.h: Prototype getopt() for C++ too. (Local fix).
+ * getopt.h: Don't mention getopt() for C++. (Local fix).
* vsnprintf.c: Actually fill it in. It is from
<URL:http://theos.com/~deraadt/snprintf.c>, with one small fix to
#define optional_argument 2
#if defined (__STDC__) && __STDC__
-#if defined __cplusplus || defined __GNU_LIBRARY__
+#ifdef __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.
-
- But, C++ is more pedantic, and demands a prototype. */
+ errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
+#ifndef __cplusplus
+/* C++ is more pedantic, and demands a full prototype, not this.
+ Hope that stdlib.h has a prototype for `getopt'. */
extern int getopt ();
+#endif /* __cplusplus */
#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);