aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc/fixlib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-01-20 18:25:12 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-01-20 18:25:12 +0000
commit52c207e293ff4337278208ed3638e3b5be78ae63 (patch)
tree088b6ad9fd2e111425c3ac61d68bf0b55e82c712 /gcc/fixinc/fixlib.c
parentd3de1cf7f0f0e2c98460a3fb50b2aee18ddbdc51 (diff)
downloadgcc-52c207e293ff4337278208ed3638e3b5be78ae63.zip
gcc-52c207e293ff4337278208ed3638e3b5be78ae63.tar.gz
gcc-52c207e293ff4337278208ed3638e3b5be78ae63.tar.bz2
Makefile.in (fixinc.sh): Depend on specs.
* 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. From-SVN: r31542
Diffstat (limited to 'gcc/fixinc/fixlib.c')
-rw-r--r--gcc/fixinc/fixlib.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/fixinc/fixlib.c b/gcc/fixinc/fixlib.c
index 40d2bbb..edd0be6 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;
+}