Re: [PATCH/RFC 2/3] compat/regex: hacks to get the gawk regex engine to compile within git
Hi!
Ævar Arnfjörð Bjarmason wrote:
> + # TODO: How do I compile just regex.o with this flag, not the
> + # whole of Git?
> + BASIC_CFLAGS += -DGAWK
gawk.o: EXTRA_CPPFLAGS = -DGAWK
See v1.7.1-rc0~60 and v1.7.0-rc0~90^2~2.
Show 14 quoted lines
> --- 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
Maybe
#if 1
#include "git-compat-util.h"
#else
...
would be simpler.