aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.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/gcc.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/gcc.c')
-rw-r--r--gcc/gcc.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7c77d46..6ad53f0 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4263,7 +4263,12 @@ do_spec_1 (spec, inswitch, soft_matched_part)
char *y;
/* Copy all of CPP_PREDEFINES into BUF,
- but put __ after every -D and at the end of each arg. */
+ but force them all into the reserved name space if they aren't already there. The reserved name space is all
+ identifiers beginning with two underscores or with one
+ underscore and a capital letter. We do the forcing by
+ adding up to two underscores to the beginning and end
+ of each symbol. e.g. mips, _mips, mips_, and _mips_ all
+ become __mips__. */
y = cpp_predefines;
while (*y != 0)
{
@@ -4279,7 +4284,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
&& ! ISUPPER ((unsigned char)*(y+1))))
{
/* Stick __ at front of macro name. */
- *x++ = '_';
+ if (*y != '_')
+ *x++ = '_';
*x++ = '_';
/* Arrange to stick __ at the end as well. */
flag = 1;
@@ -4291,8 +4297,12 @@ do_spec_1 (spec, inswitch, soft_matched_part)
if (flag)
{
- *x++ = '_';
- *x++ = '_';
+ if (x[-1] != '_')
+ {
+ if (x[-2] != '_')
+ *x++ = '_';
+ *x++ = '_';
+ }
}
/* Copy the value given, if any. */
@@ -4324,7 +4334,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* Stick -D__ at front of macro name. */
*x++ = '-';
*x++ = 'D';
- *x++ = '_';
+ if (*y != '_')
+ *x++ = '_';
*x++ = '_';
/* Copy the macro name. */