Prototype getopt() for C++ too. (Local fix).
authorRaja R Harinath <harinath@src.gnome.org>
Wed, 11 Mar 1998 23:17:52 +0000 (23:17 +0000)
committerRaja R Harinath <harinath@src.gnome.org>
Wed, 11 Mar 1998 23:17:52 +0000 (23:17 +0000)
* getopt.h: Prototype getopt() for C++ too.  (Local fix).

- Hari

svn path=/trunk/; revision=139

support/ChangeLog
support/getopt.h

index 73e419c..971dc14 100644 (file)
@@ -1,5 +1,7 @@
 1998-03-11  Raja R Harinath  <harinath@cs.umn.edu>
 
+       * getopt.h: Prototype getopt() for C++ too.  (Local fix).
+
        * vsnprintf.c: Actually fill it in.  It is from
        <URL:http://theos.com/~deraadt/snprintf.c>, with one small fix to
        actually make it compile. 
index 68958c1..de4b4e0 100644 (file)
@@ -97,10 +97,12 @@ struct option
 #define optional_argument      2
 
 #if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
+#if defined __cplusplus || 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.  */
+   errors, only prototype getopt for the GNU C library.
+
+   But, C++ is more pedantic, and demands a prototype.  */
 extern int getopt (int argc, char *const *argv, const char *shortopts);
 #else /* not __GNU_LIBRARY__ */
 extern int getopt ();