diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-04-02 23:03:30 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-04-02 23:08:00 +0200 |
commit | d68a600d005d9c110145310dc249daaf73653436 (patch) | |
tree | 2c3cc0dc394ac50430d11f45a074845c52b53f3d /include | |
parent | d76eb9dd46081279642d3353f51ebc09fe4bbe9f (diff) |
Add a libcompat implementation for getopt_long
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/compat.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/compat.h b/include/compat.h index 6f8a77d..cb5ff23 100644 --- a/include/compat.h +++ b/include/compat.h @@ -204,6 +204,20 @@ extern char *optarg; int getopt(int argc, char *const argv[], const char *optstr); #endif +#ifndef HAVE_GETOPT_LONG +struct option { + const char *name; + int has_arg; + int val; +}; + +#define no_argument 0 +#define required_argument 1 + +int getopt_long(int argc, char *const argv[], const char *optstr, + const struct option *longopts, int *longindex); +#endif + #if defined(_WIN32) || defined(__WINDOWS__) WCHAR *path_to_windows(const char *input); #endif |