diff --git a/src/setopt.hpp b/src/setopt.hpp index bbd5104..7fa186a 100644 --- a/src/setopt.hpp +++ b/src/setopt.hpp @@ -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;