From d68a600d005d9c110145310dc249daaf73653436 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 2 Apr 2020 23:03:30 +0200 Subject: Add a libcompat implementation for getopt_long Signed-off-by: David Oberhollenzer --- include/compat.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/compat.h') 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 -- cgit v1.2.3