aboutsummaryrefslogtreecommitdiffhomepage
path: root/fallback.h
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-08-28 21:43:05 +1000
committerGravatar axel <axel@liljencrantz.se>2006-08-28 21:43:05 +1000
commit548e379d6a0ef2e8523f261d84c2ea5852f5577d (patch)
treeb218f930017cb56fa0c956e92f168d368da68f62 /fallback.h
parent202d29de8886e9574639f5f6877a05c9fc3e79b0 (diff)
Provide fallback version of getopt_long instead of checking for it's presense every time it is used
darcs-hash:20060828114305-ac50b-f4aad19e936fa42bbe84e51e72aa32445a469527.gz
Diffstat (limited to 'fallback.h')
-rw-r--r--fallback.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/fallback.h b/fallback.h
index 323a690c..5f3b1af7 100644
--- a/fallback.h
+++ b/fallback.h
@@ -385,5 +385,37 @@ extern int _nl_msg_cat_cntr;
int killpg( int pgr, int sig );
#endif
+
+#ifndef HAVE_WORKING_GETOPT_LONG
+
+struct option
+{
+ const char *name;
+ int has_arg;
+ int *flag;
+ int val;
+}
+ ;
+
+#ifndef no_argument
+#define no_argument 0
+#endif
+
+#ifndef required_argument
+#define required_argument 1
+#endif
+
+#ifndef optional_argument
+#define optional_argument 2
+#endif
+
+int getopt_long(int argc,
+ char * const argv[],
+ const char *optstring,
+ const struct option *longopts,
+ int *longindex);
+
+#endif
+
#endif