summaryrefslogtreecommitdiff
path: root/support/getopt.h
diff options
context:
space:
mode:
authorRaja R Harinath <harinath@src.gnome.org>1998-03-11 23:28:44 +0000
committerRaja R Harinath <harinath@src.gnome.org>1998-03-11 23:28:44 +0000
commitab31af4723bf35df49b0a40c1b8c5310bed108a3 (patch)
tree76043d952fe9f000059bca0c3a9ec40ee4a44bce /support/getopt.h
parent1803db77ac366ed85c231edd520547fc96e9531c (diff)
downloadshared-mime-info-ab31af4723bf35df49b0a40c1b8c5310bed108a3.tar.gz
Don't mention getopt() for C++. (Local fix).
* getopt.h: Don't mention getopt() for C++. (Local fix). This is IMHO better than my previous commit. -- Hari svn path=/trunk/; revision=140
Diffstat (limited to 'support/getopt.h')
-rw-r--r--support/getopt.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/support/getopt.h b/support/getopt.h
index de4b4e0b..9b25f902 100644
--- a/support/getopt.h
+++ b/support/getopt.h
@@ -97,15 +97,17 @@ struct option
#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);