aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-05-25 20:57:47 +0200
committerDuncaen <mail@duncano.de>2017-05-25 20:57:50 +0200
commitac6721edcc59d588731a5e43156e46b01377ca47 (patch)
tree85b476c54441575ad6c315501063d80e137a59ce
parentcbab257026a7298fdb63370c83de3c94fc4502f7 (diff)
downloadlobase-ac6721edcc59d588731a5e43156e46b01377ca47.tar.gz
include/{unistd,getopt}.h: fix getopt(3) redefinition
-rw-r--r--include/getopt.h10
-rw-r--r--include/unistd.h7
2 files changed, 8 insertions, 9 deletions
diff --git a/include/getopt.h b/include/getopt.h
index 103950f..1597532 100644
--- a/include/getopt.h
+++ b/include/getopt.h
@@ -33,9 +33,6 @@
#ifndef _COMPAT_GETOPT_H_
#define _COMPAT_GETOPT_H_
-#define getopt(argc, argv, optstr) \
- openbsd_getopt(argc, argv, optstr)
-
#define getopt_long(argc, argv, optstr, longopts, longindex) \
openbsd_getopt_long_only(argc, argv, optstr, longopts, longindex)
@@ -70,9 +67,10 @@ int getopt_long_only(int, char * const *, const char *,
const struct option *, int *);
#ifndef _GETOPT_DEFINED_
#define _GETOPT_DEFINED_
-#define getopt openbsd_getopt
-#define opterr openbsd_opterr
-#define optind openbsd_optind
+#define getopt(argc, argv, optstr) \
+ openbsd_getopt(argc, argv, optstr)
+#define opterr openbsd_opterr
+#define optind openbsd_optind
int getopt(int, char * const *, const char *);
extern char *optarg; /* getopt(3) external variables */
diff --git a/include/unistd.h b/include/unistd.h
index fb381e2..6fdb66d 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -56,9 +56,10 @@ int pledge(const char *, const char *[]);
#ifndef _GETOPT_DEFINED_
#define _GETOPT_DEFINED_
-#define getopt openbsd_getopt
-#define opterr openbsd_opterr
-#define optind openbsd_optind
+#define getopt(argc, argv, optstr) \
+ openbsd_getopt(argc, argv, optstr)
+#define opterr openbsd_opterr
+#define optind openbsd_optind
int getopt(int, char * const *, const char *);
extern char *optarg; /* getopt(3) external variables */
extern int opterr, optind, optopt, optreset;