summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include/getopt.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-12-17 21:34:59 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-12-17 21:34:59 +0000
commit6d114a5deaef53604eef013167f3694dbd0c13f5 (patch)
treee9ee8db4b0150efef76aa8a7c481d8251a819aa7 /winsup/cygwin/include/getopt.h
parentefeae9a3177285440741dee9b371e4b07b12bb41 (diff)
downloadcygnal-6d114a5deaef53604eef013167f3694dbd0c13f5.tar.gz
cygnal-6d114a5deaef53604eef013167f3694dbd0c13f5.tar.bz2
cygnal-6d114a5deaef53604eef013167f3694dbd0c13f5.zip
* include/getopt.h: Don't define getopt_long() and friends when
included through unistd.h.
Diffstat (limited to 'winsup/cygwin/include/getopt.h')
-rw-r--r--winsup/cygwin/include/getopt.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/winsup/cygwin/include/getopt.h b/winsup/cygwin/include/getopt.h
index beca375c8..d3a3df9b8 100644
--- a/winsup/cygwin/include/getopt.h
+++ b/winsup/cygwin/include/getopt.h
@@ -38,13 +38,6 @@
extern "C" {
#endif
-struct option {
- const char *name;
- int has_arg;
- int *flag;
- int val;
-};
-
extern int opterr; /* if error message should be printed */
extern int optind; /* index into parent argv vector */
extern int optopt; /* character checked for validity */
@@ -53,6 +46,27 @@ extern char *optarg; /* argument associated with option */
int getopt (int, char * const *, const char *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GETOPT_H__ */
+
+#ifndef __UNISTD_GETOPT__
+#ifndef __GETOPT_LONG_H__
+#define __GETOPT_LONG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct option {
+ const char *name;
+ int has_arg;
+ int *flag;
+ int val;
+};
+
int getopt_long (int, char *const *, const char *, const struct option *, int *);
#define HAVE_DECL_GETOPT 1
@@ -64,4 +78,5 @@ int getopt_long (int, char *const *, const char *, const struct option *, int *)
}
#endif
-#endif /* __GETOPT_H__ */
+#endif /* __GETOPT_LONG_H__ */
+#endif /* __UNISTD_GETOPT__ */