20 lines
744 B
Diff
20 lines
744 B
Diff
|
Since the musl libc constellation results in unistd.h being
|
||
|
included, which defines the getopt() function but not the
|
||
|
getopt globals, define them here as well.
|
||
|
|
||
|
--- src/dar_suite/my_getopt_long.h 2015-10-17 10:42:50.000000000 +0200
|
||
|
+++ src/dar_suite/my_getopt_long.h 2015-10-18 13:13:32.631006858 +0200
|
||
|
@@ -27,6 +27,12 @@
|
||
|
#ifndef MY_GETOPT_LONG_H
|
||
|
#define MY_GETOPT_LONG_H
|
||
|
|
||
|
+#if !defined(__GLIBC__)
|
||
|
+// declare externs which would be defined when including getopt.h
|
||
|
+extern char *optarg;
|
||
|
+extern int optind, opterr, optopt, optreset;
|
||
|
+#endif
|
||
|
+
|
||
|
// getopt may be declated in <unistd.h> on systems like FreeBSD.
|
||
|
// if you want to use libgnugetopt you need to include <getopt.h>
|
||
|
// on this system. Thus a conflict appear because the getopt is
|