[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getopt broken
From: |
Eric Blake |
Subject: |
Re: getopt broken |
Date: |
Sat, 26 Sep 2009 16:32:15 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----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 address@hidden
-----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 <address@hidden>
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 <address@hidden>
---
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 <address@hidden>
+ 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