Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/include/getopt.h')
-rw-r--r--winsup/cygwin/include/getopt.h34
1 files changed, 26 insertions, 8 deletions
diff --git a/winsup/cygwin/include/getopt.h b/winsup/cygwin/include/getopt.h
index b05b32fdd..6b6f643b7 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,7 +46,31 @@ 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 *);
+#ifndef HAVE_DECL_GETOPT
+#define HAVE_DECL_GETOPT 1
+#endif
#define no_argument 0
#define required_argument 1
@@ -63,4 +80,5 @@ int getopt_long (int, char *const *, const char *, const struct option *, int *)
}
#endif
-#endif /* __GETOPT_H__ */
+#endif /* __GETOPT_LONG_H__ */
+#endif /* __UNISTD_GETOPT__ */