lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit ac6721edcc59d588731a5e43156e46b01377ca47
parent cbab257026a7298fdb63370c83de3c94fc4502f7
Author: Duncaen <mail@duncano.de>
Date:   Thu, 25 May 2017 20:57:47 +0200

include/{unistd,getopt}.h: fix getopt(3) redefinition

Diffstat:
include/getopt.h | 10++++------
include/unistd.h | 7++++---
2 files changed, 8 insertions(+), 9 deletions(-)

diff --git 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 @@ -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;