getopt compatibility

This commit is contained in:
anon 2023-06-20 13:19:34 +02:00
parent 853c9ed2d7
commit 05fa1caa61

View File

@ -23,6 +23,11 @@ enum {
SETOPTUNKNOWNOPT
};
// Define getopt stuff if it wasnt already
// NOTE: this could result in a symbol redefinition error
// if someone were to include this header only library
// before linked ones for some reason.
#ifndef _GETOPT_H
struct option {
const char *name;
int has_arg;
@ -35,6 +40,7 @@ enum {
required_argument = 1,
optional_argument = 2
};
#endif /* getopt.h */
int optc, optred, opterrno = 0;