[PATCH/RFC v2 2/3] compat/regex: get the gawk regex engine to compile within git

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?=
Date: Monday, August 16, 2010 - 10:17 pm

We need to define -DGAWK -DNO_MBSUPPORT so that the gawk regex engine
will compile, and include stdio.h and stddef.h in regex.h. Gawk itself
includes these headers before it includes the regex.h header.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile             |    4 ++++
 compat/regex/regex.h |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index b4745a5..23a9f0d 100644
--- a/Makefile
+++ b/Makefile
@@ -1879,6 +1879,10 @@ ifdef NO_EXPAT
 http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
 endif
 
+ifdef NO_REGEX
+compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
+endif
+
 git-%$X: %.o $(GITLIBS)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
 
diff --git a/compat/regex/regex.h b/compat/regex/regex.h
index de93327..61c9683 100644
--- a/compat/regex/regex.h
+++ b/compat/regex/regex.h
@@ -1,3 +1,6 @@
+#include <stdio.h>
+#include <stddef.h>
+
 /* Definitions for data structures and routines for the regular
    expression library.
    Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006,2008
-- 
1.7.2.1.389.gc3d0b

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] grep: Don't pass a TODO test if REG_STARTEND is su ..., =?UTF-8?q?=C3=86var= ..., (Wed Jul 7, 5:42 pm)
Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND i ..., Ævar Arnfjörð Bjarmason, (Thu Jul 8, 1:09 pm)
Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND i ..., Ævar Arnfjörð Bjarmason, (Thu Jul 15, 8:32 am)
Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND i ..., Ævar Arnfjörð Bjarmason, (Thu Jul 15, 11:44 am)
Re: [RFC/PATCH] Update compat/regex, Ævar Arnfjörð Bjarmason, (Fri Jul 16, 6:58 am)
Re: [RFC/PATCH] Update compat/regex, Andreas Schwab, (Fri Jul 16, 7:17 am)
Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND i ..., Ævar Arnfjörð Bjarmason, (Fri Jul 16, 7:33 am)
Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND i ..., Ævar Arnfjörð Bjarmason, (Fri Jul 16, 1:51 pm)
Re: [PATCH] grep: Don't pass a TODO test if REG_STARTEND i ..., Ævar Arnfjörð Bjarmason, (Fri Jul 16, 2:19 pm)
Re: [RFC/PATCH] Update compat/regex, Ævar Arnfjörð Bjarmason, (Sun Aug 15, 4:08 am)
Re: [RFC/PATCH] Update compat/regex, Paolo Bonzini, (Mon Aug 16, 5:26 am)
[PATCH/RFC 0/3] Update compat/regex, =?UTF-8?q?=C3=86var= ..., (Mon Aug 16, 8:25 pm)
[PATCH/RFC 2/3] compat/regex: hacks to get the gawk regex ..., =?UTF-8?q?=C3=86var= ..., (Mon Aug 16, 8:25 pm)
[PATCH/RFC 3/3] t/t7008-grep-binary.sh: un-TODO a test tha ..., =?UTF-8?q?=C3=86var= ..., (Mon Aug 16, 8:25 pm)
Re: [PATCH/RFC 1/3] compat/regex: use the regex engine fro ..., Ævar Arnfjörð Bjarmason, (Mon Aug 16, 8:50 pm)
[PATCH/RFC v2 0/3] Update compat/regex, =?UTF-8?q?=C3=86var= ..., (Mon Aug 16, 10:17 pm)
[PATCH/RFC v2 2/3] compat/regex: get the gawk regex engine ..., =?UTF-8?q?=C3=86var= ..., (Mon Aug 16, 10:17 pm)
[PATCH/RFC v2 3/3] t/t7008-grep-binary.sh: un-TODO a test ..., =?UTF-8?q?=C3=86var= ..., (Mon Aug 16, 10:17 pm)
Re: [PATCH/RFC v2 0/3] Update compat/regex, Jonathan Nieder, (Tue Aug 17, 1:03 am)
[PATCH 0/5] Update compat/regex, =?UTF-8?q?=C3=86var= ..., (Tue Aug 17, 2:24 am)
[PATCH 2/5] compat/regex: get the gawk regex engine to com ..., =?UTF-8?q?=C3=86var= ..., (Tue Aug 17, 2:24 am)
[PATCH 3/5] Change regerror() declaration from K&amp;R style t ..., =?UTF-8?q?=C3=86var= ..., (Tue Aug 17, 2:24 am)
[PATCH 4/5] t/t7008-grep-binary.sh: un-TODO a test that ne ..., =?UTF-8?q?=C3=86var= ..., (Tue Aug 17, 2:24 am)
[PATCH 5/5] autoconf: don't use platform regex if it lacks ..., =?UTF-8?q?=C3=86var= ..., (Tue Aug 17, 2:24 am)
Re: [PATCH 0/5] Update compat/regex, Paolo Bonzini, (Tue Aug 17, 4:46 am)
Re: [PATCH 0/5] Update compat/regex, Junio C Hamano, (Tue Aug 17, 4:19 pm)
Re: [PATCH 0/5] Update compat/regex, Jonathan Nieder, (Tue Aug 17, 4:50 pm)
Re: [PATCH 0/5] Update compat/regex, Ævar Arnfjörð Bjarmason, (Wed Aug 18, 3:41 am)