-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 9/26/2009 3:30 PM: >> Any ideas how to fix it? > > Sounds like we need to follow the pattern of other replacement headers, > and use #if @REPLACE_GETOPT@ rather than #ifdef __GETOPT_PREFIX > everywhere. I'll see what I can do.
It turned out there is a much simpler fix. Since glibc #define's _GETOPT_H, our <getopt.h> replacement thought it had already been included, and short-circuited. If we use a different name, then everything works out. I'm pushing this: - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkq+lm8ACgkQ84KuGfSFAYD8UgCeLNaNucVd2StoX+2JZ4sHDipE 5ScAnRdu6VeOPo2F5YlNm8a0yllExPk4 =lcvB -----END PGP SIGNATURE-----
>From 35cea22b36cbb5906e0387516feb28c3d1ef3ec3 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Sat, 26 Sep 2009 16:28:24 -0600 Subject: [PATCH] argp: fix compilation of getopt * lib/getopt.in.h (includes): Use different guard than glibc. Reported by Sergey Poznyakoff. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 4 ++++ lib/getopt.in.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 385f048..f1bcf69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-09-26 Eric Blake <e...@byu.net> + argp: fix compilation of getopt + * lib/getopt.in.h (includes): Use different guard than glibc. + Reported by Sergey Poznyakoff. + doc: mention more cygwin 1.7 status * doc/posix-functions/access.texi (access): Mention cygwin 1.5 bug. diff --git a/lib/getopt.in.h b/lib/getopt.in.h index e23259c..15c213f 100644 --- a/lib/getopt.in.h +++ b/lib/getopt.in.h @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _GETOPT_H +#ifndef _GL_GETOPT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -27,10 +27,10 @@ # @INCLUDE_NEXT@ @NEXT_GETOPT_H@ #endif -#ifndef _GETOPT_H +#ifndef _GL_GETOPT_H #ifndef __need_getopt -# define _GETOPT_H 1 +# define _GL_GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an -- 1.6.5.rc1