[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #31096] grep 2.7 compilation fails on Hurd
From: |
Jim Meyering |
Subject: |
Re: [bug #31096] grep 2.7 compilation fails on Hurd |
Date: |
Tue, 21 Sep 2010 16:35:08 +0200 |
Matthias Lanzinger wrote:
> <http://savannah.gnu.org/bugs/?31096>
>
> Summary: grep 2.7 compilation fails on Hurd
>
> Hi
>
> The changes introduced to dfawarn in src/dfasearch.h cause compilation on
> Hurd to fail.
> The reason for this is that the 'GNU' macro is, on the Hurd, defined in
> sys/params.h from glibc as following:
> #define GNU 1994100 /* GNU version (year, month, and release).
> */
>
> I didn't attach a patch because the change seems straightforward to me and I
> wasn't sure on how you'd like the enum elements renamed.
>
> Just for the sake of completeness, make check passes all tests when building
> with GNU renamed to MODE_GNU in dfawarn.
>
> Pleas consider fixing this.
Thanks for the report.
This patch should do it:
>From b92e6c21642dd200e3e352997f20ab9bfb556a61 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 21 Sep 2010 16:33:41 +0200
Subject: [PATCH] build: avoid compilation failure on the Hurd
* src/dfasearch.c (dfawarn): Rename enum symbols to use DW_ prefix,
so as not to collide with "GNU", which is defined by the Hurd.
Reported by Matthias Lanzinger in http://savannah.gnu.org/bugs/?31096
---
src/dfasearch.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/dfasearch.c b/src/dfasearch.c
index 44eb08a..780891f 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -61,10 +61,10 @@ dfaerror (char const *mesg)
void
dfawarn (char const *mesg)
{
- static enum { NONE = 0, POSIX, GNU } mode;
- if (mode == NONE)
- mode = (getenv ("POSIXLY_CORRECT") ? POSIX : GNU);
- if (mode == GNU)
+ static enum { DW_NONE = 0, DW_POSIX, DW_GNU } mode;
+ if (mode == DW_NONE)
+ mode = (getenv ("POSIXLY_CORRECT") ? DW_POSIX : DW_GNU);
+ if (mode == DW_GNU)
dfaerror (mesg);
}
--
1.7.3.234.g7bba3