>From 572ec0f49f36457be8802cb2c855c4cec318234e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 11 Jun 2017 15:53:09 -0700 Subject: [PATCH] getopt-posix: port to glibc 2.25.90 Problem reported by Daniel P. Berrange in: http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00003.html * lib/getopt-pfx-core.h (_GETOPT_CORE_H): * lib/getopt-pfx-ext.h (_GETOPT_EXT_H): #undef if __GETOPT_PREFIX is defined. --- ChangeLog | 9 +++++++++ lib/getopt-pfx-core.h | 5 +++++ lib/getopt-pfx-ext.h | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0e32d27..017ec4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2017-06-11 Paul Eggert + + getopt-posix: port to glibc 2.25.90 + Problem reported by Daniel P. Berrange in: + http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00003.html + * lib/getopt-pfx-core.h (_GETOPT_CORE_H): + * lib/getopt-pfx-ext.h (_GETOPT_EXT_H): + #undef if __GETOPT_PREFIX is defined. + 2017-06-11 Bruno Haible strtod-obsolete: Fix license. diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h index 155c116..6ad0da6 100644 --- a/lib/getopt-pfx-core.h +++ b/lib/getopt-pfx-core.h @@ -47,6 +47,11 @@ # define opterr __GETOPT_ID (opterr) # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) + +/* The system's getopt.h may have already included getopt-core.h to + declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that + getopt-core.h declares them with prefixes. */ +# undef _GETOPT_CORE_H #endif #include diff --git a/lib/getopt-pfx-ext.h b/lib/getopt-pfx-ext.h index d960bb3..c5ac522 100644 --- a/lib/getopt-pfx-ext.h +++ b/lib/getopt-pfx-ext.h @@ -45,6 +45,11 @@ # define getopt_long_only __GETOPT_ID (getopt_long_only) # define option __GETOPT_ID (option) # define _getopt_internal __GETOPT_ID (getopt_internal) + +/* The system's getopt.h may have already included getopt-ext.h to + declare the unprefixed identifiers. Undef _GETOPT_EXT_H so that + getopt-ext.h declares them with prefixes. */ +# undef _GETOPT_EXT_H #endif /* Standalone applications get correct prototypes for getopt_long and -- 2.7.4