aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-03-13 00:10:13 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-03-13 00:10:13 +0000
commit6feb772821f473bad8f16e0959100bd404363ff2 (patch)
tree8e461958ce7225c47f8f03c091b7a7d2ef297653 /gcc/cppinit.c
parentd35364d13e14ba0eea541a77484c716f1cf82195 (diff)
downloadgcc-6feb772821f473bad8f16e0959100bd404363ff2.zip
gcc-6feb772821f473bad8f16e0959100bd404363ff2.tar.gz
gcc-6feb772821f473bad8f16e0959100bd404363ff2.tar.bz2
cpphash.c: Don't include version.h.
* cpphash.c: Don't include version.h. (special_symbol) [case T_VERSION]: Look for the string in hp->value.cpval; don't use version_string. * cppinit.c (initialize_builtins): Set hp->value.cpval for __VERSION__ to version_string. * Makefile.in (cpphash.o): Update deps. From-SVN: r32499
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index f6fd246c..0eb2a29 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -608,7 +608,8 @@ struct builtin
};
#define DUMP 0x01
#define STDC 0x02
-#define ULP 0x10
+#define VERS 0x04
+#define ULP 0x08
static const struct builtin builtin_array[] =
{
@@ -618,7 +619,7 @@ static const struct builtin builtin_array[] =
{ "__BASE_FILE__", 0, T_BASE_FILE, 0 },
{ "__LINE__", 0, T_SPECLINE, 0 },
{ "__INCLUDE_LEVEL__", 0, T_INCLUDE_LEVEL, 0 },
- { "__VERSION__", 0, T_VERSION, DUMP },
+ { "__VERSION__", 0, T_VERSION, DUMP|VERS },
{ "__STDC__", 0, T_STDC, DUMP|STDC },
{ "__USER_LABEL_PREFIX__", 0, T_CONST, ULP },
@@ -651,9 +652,14 @@ initialize_builtins (pfile)
if ((b->flags & STDC) && CPP_TRADITIONAL (pfile))
continue;
- val = (b->flags & ULP) ? user_label_prefix : b->value;
- len = strlen (b->name);
+ if (b->flags & ULP)
+ val = user_label_prefix;
+ else if (b->flags & VERS)
+ val = version_string;
+ else
+ val = b->value;
+ len = strlen (b->name);
hp = _cpp_make_hashnode (b->name, len, b->type, -1);
hp->value.cpval = val;
*(htab_find_slot (pfile->hashtab, (void *)hp, 1)) = hp;
@@ -665,6 +671,7 @@ initialize_builtins (pfile)
}
#undef DUMP
#undef STDC
+#undef VERS
#undef ULP
/* Another subroutine of cpp_start_read. This one sets up to do