diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-20 18:25:12 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-20 18:25:12 +0000 |
commit | 17f8e52193ff9b0ded75d9c4d5e8a19cff7a56f5 (patch) | |
tree | 088b6ad9fd2e111425c3ac61d68bf0b55e82c712 /gcc/fixinc/fixlib.c | |
parent | 1e53290d823e4449fba0c2817194582e6bc387b3 (diff) | |
download | gcc-17f8e52193ff9b0ded75d9c4d5e8a19cff7a56f5.tar.gz |
* Makefile.in (fixinc.sh): Depend on specs.
* fixinc/Makefile.in: Add rule to create machname.h.
(fixlib.o): Depend on machname.h.
* fixinc/fixtests.c (machine_name): New test.
* fixinc/fixfixes.c (machine_name): New fix.
* fixinc/fixlib.c (mn_get_regexps): New helper function for
the machine_name test and fix.
* fixinc/fixlib.h: Prototype it.
* fixinc/inclhack.def (machine_name): Use the C test and fix.
* fixinc/fixincl.x, fixinc/inclhack.sh: Rebuild.
* gcc.c (do_spec_1) [case P]: Take care not to create
identifiers with three leading or trailing underscores.
* fixinc/Makefile.in (FIXINC_DEFS): Add -DIN_GCC.
(fixincl): Don't specify libraries twice on link line.
(gnu-regex.o): Remove special rule.
* fixinc/gnu-regex.c: Define REGEX_MALLOC if C_ALLOCA was
defined by config.h. Do not define _REGEX_RE_COMP.
(regcomp): Allocate and initialize a fastmap.
* fixinc/gnu-regex.h: Do not define _REGEX_RE_COMP.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31542 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc/fixlib.c')
-rw-r--r-- | gcc/fixinc/fixlib.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/fixinc/fixlib.c b/gcc/fixinc/fixlib.c index 40d2bbb84c3..edd0be6daab 100644 --- a/gcc/fixinc/fixlib.c +++ b/gcc/fixinc/fixlib.c @@ -171,3 +171,34 @@ compile_re( pat, re, match, e1, e2 ) exit (EXIT_FAILURE); } } + +/* * * * * * * * * * * * * + + Helper routine and data for the machine_name test and fix. + machname.h is created by black magic in the Makefile. */ + +#include "machname.h" + +tSCC mn_label_pat[] = "^[ \t]*#[ \t]*(if|ifdef|ifndef)[ \t]+"; +static regex_t mn_label_re; + +tSCC mn_name_pat[] = MN_NAME_PAT; +static regex_t mn_name_re; + +static int mn_compiled = 0; + +void +mn_get_regexps( label_re, name_re, who ) + regex_t **label_re; + regex_t **name_re; + tCC *who; +{ + if (! mn_compiled) + { + compile_re (mn_label_pat, &mn_label_re, 1, "label pattern", who); + compile_re (mn_name_pat, &mn_name_re, 1, "name pattern", who); + mn_compiled++; + } + *label_re = &mn_label_re; + *name_re = &mn_name_re; +} |