From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Paolo Bonzini" <paolo.bonzini@gmail.com>,
"Andreas Schwab" <schwab@linux-m68k.org>,
"Jonathan Nieder" <jrnieder@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH/RFC 2/3] compat/regex: hacks to get the gawk regex engine to compile within git
Date: Tue, 17 Aug 2010 03:25:47 +0000 [thread overview]
Message-ID: <1282015548-19074-3-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <AANLkTik4FL56EM4HdpfZ7ha8GNkbLsJeb415WFWUh+O_@mail.gmail.com>
The gawk regex engine didn't include stdio.h, and only include
stddef.h if HAVE_STDDEF_H is set.
Adding -DHAVE_STDDEF_H caused some internal errors in by /usr/include
headers, so change the regex.h code to include it unconditionally.
We also need to define -DGAWK so that e.g. "bool", "MAX" and other
similar things used inside gawk get defined.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Makefile | 4 ++++
compat/regex/regex.h | 7 +++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b4745a5..6704780 100644
--- a/Makefile
+++ b/Makefile
@@ -1443,6 +1443,10 @@ ifdef UNRELIABLE_FSTAT
BASIC_CFLAGS += -DUNRELIABLE_FSTAT
endif
ifdef NO_REGEX
+ # TODO: How do I compile just regex.o with this flag, not the
+ # whole of Git?
+ BASIC_CFLAGS += -DGAWK
+
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
diff --git a/compat/regex/regex.h b/compat/regex/regex.h
index de93327..508bc80 100644
--- a/compat/regex/regex.h
+++ b/compat/regex/regex.h
@@ -22,9 +22,12 @@
#ifndef _REGEX_H
#define _REGEX_H 1
-#ifdef HAVE_STDDEF_H
+#include <stdio.h>
+/*
+ Git: Was in `#ifdef HAVE_STDDEF_H` in gawk, adding -DHAVE_STDDEF_H makes a
+ *lot* of other things break
+*/
#include <stddef.h>
-#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
--
1.7.2.1.389.gc3d0b
next prev parent reply other threads:[~2010-08-17 3:26 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-08 0:42 [PATCH] grep: Don't pass a TODO test if REG_STARTEND is supported Ævar Arnfjörð Bjarmason
2010-07-08 19:40 ` Junio C Hamano
2010-07-08 20:09 ` Ævar Arnfjörð Bjarmason
2010-07-08 21:58 ` René Scharfe
2010-07-15 15:32 ` Ævar Arnfjörð Bjarmason
2010-07-15 17:47 ` Junio C Hamano
2010-07-15 18:44 ` Ævar Arnfjörð Bjarmason
[not found] ` <20100715220059.GA3312@burratino>
2010-07-16 13:58 ` [RFC/PATCH] Update compat/regex Ævar Arnfjörð Bjarmason
2010-07-16 14:17 ` Andreas Schwab
2010-08-15 11:08 ` Ævar Arnfjörð Bjarmason
2010-08-16 12:26 ` Paolo Bonzini
2010-08-17 3:25 ` [PATCH/RFC 0/3] " Ævar Arnfjörð Bjarmason
2010-08-17 3:25 ` Ævar Arnfjörð Bjarmason [this message]
2010-08-17 3:35 ` [PATCH/RFC 2/3] compat/regex: hacks to get the gawk regex engine to compile within git Jonathan Nieder
2010-08-17 3:25 ` [PATCH/RFC 3/3] t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND Ævar Arnfjörð Bjarmason
[not found] ` <1282015548-19074-2-git-send-email-avarab@gmail.com>
2010-08-17 3:37 ` [PATCH/RFC 1/3] compat/regex: use the regex engine from gawk for compat Jonathan Nieder
2010-08-17 3:50 ` Ævar Arnfjörð Bjarmason
2010-08-17 4:08 ` Jonathan Nieder
2010-08-17 5:17 ` [PATCH/RFC v2 0/3] Update compat/regex Ævar Arnfjörð Bjarmason
2010-08-17 8:03 ` Jonathan Nieder
2010-08-17 9:24 ` [PATCH 0/5] " Ævar Arnfjörð Bjarmason
2010-08-17 11:46 ` Paolo Bonzini
2010-08-17 23:19 ` Junio C Hamano
2010-08-17 23:50 ` Jonathan Nieder
2010-08-18 10:41 ` Ævar Arnfjörð Bjarmason
2010-08-17 9:24 ` [PATCH 2/5] compat/regex: get the gawk regex engine to compile within git Ævar Arnfjörð Bjarmason
2010-08-17 9:24 ` [PATCH 3/5] Change regerror() declaration from K&R style to ANSI C (C89) Ævar Arnfjörð Bjarmason
2010-08-17 9:24 ` [PATCH 4/5] t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND Ævar Arnfjörð Bjarmason
2010-08-17 9:24 ` [PATCH 5/5] autoconf: don't use platform regex if it lacks REG_STARTEND Ævar Arnfjörð Bjarmason
2010-08-17 5:17 ` [PATCH/RFC v2 2/3] compat/regex: get the gawk regex engine to compile within git Ævar Arnfjörð Bjarmason
2010-08-17 5:17 ` [PATCH/RFC v2 3/3] t/t7008-grep-binary.sh: un-TODO a test that needs REG_STARTEND Ævar Arnfjörð Bjarmason
2010-07-16 14:33 ` [PATCH] grep: Don't pass a TODO test if REG_STARTEND is supported Ævar Arnfjörð Bjarmason
2010-07-16 19:50 ` Jonathan Nieder
2010-07-16 20:51 ` Ævar Arnfjörð Bjarmason
2010-07-16 21:06 ` Jonathan Nieder
2010-07-16 21:19 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282015548-19074-3-git-send-email-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=paolo.bonzini@gmail.com \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).