3 #include "lldb/lldb-defines.h"
7 #define REPLACE_GETOPT_LONG
9 #if defined(_MSC_VER) || defined(__NetBSD__)
10 #define REPLACE_GETOPT_LONG_ONLY
13 #if defined(REPLACE_GETOPT)
16 #define required_argument 1
17 #define optional_argument 2
22 // has_arg can't be an enum because some compilers complain about
23 // type mismatches in all the code that assumes it is an int.
29 int getopt(int argc, char *const argv[], const char *optstring);
37 // defined in unistd.h
44 #if defined(REPLACE_GETOPT_LONG)
45 int getopt_long(int argc, char *const *argv, const char *optstring,
46 const struct option *longopts, int *longindex);
49 #if defined(REPLACE_GETOPT_LONG_ONLY)
50 int getopt_long_only(int argc, char *const *argv, const char *optstring,
51 const struct option *longopts, int *longindex);