diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-13 06:45:59 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-13 06:45:59 -0500 |
commit | 54a88f9251258e2ce0908499022cbc38152d1b27 (patch) | |
tree | a3cd643148dca7009ba477f2f5c3d3c6f9607606 /gcc | |
parent | c5ea5f3b3384e4f4cf49debdcc3dfba7a74db3fa (diff) | |
download | gcc-54a88f9251258e2ce0908499022cbc38152d1b27.zip gcc-54a88f9251258e2ce0908499022cbc38152d1b27.tar.gz gcc-54a88f9251258e2ce0908499022cbc38152d1b27.tar.bz2 |
(do_spec_1): Don't duplicate a macro starting with '__'.
From-SVN: r6764
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gcc.c | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -3254,23 +3254,30 @@ do_spec_1 (spec, inswitch, soft_matched_part) { if (! strncmp (y, "-D", 2)) { - *x++ = *y++; - *x++ = *y++; + y += 2; if (strncmp (y, "__", 2)) { - /* Stick __ at front of macro name. */ + /* Stick -D__ at front of macro name. */ + *x++ = '-'; + *x++ = 'D'; *x++ = '_'; *x++ = '_'; - } - /* Copy the macro name. */ - while (*y && *y != '=' && *y != ' ' && *y != '\t') - *x++ = *y++; + /* Copy the macro name. */ + while (*y && *y != '=' && *y != ' ' && *y != '\t') + *x++ = *y++; - /* Copy the value given, if any. */ - while (*y && *y != ' ' && *y != '\t') - *x++ = *y++; + /* Copy the value given, if any. */ + while (*y && *y != ' ' && *y != '\t') + *x++ = *y++; + } + else + { + /* Do not copy this macro - we have just done it before */ + while (*y && *y != ' ' && *y != '\t') + y++; + } } else if (*y == ' ' || *y == '\t') /* Copy whitespace to the result. */ |