OSDN Git Service

* cpphash.c: Don't include version.h.
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Mar 2000 00:10:13 +0000 (00:10 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Mar 2000 00:10:13 +0000 (00:10 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32499 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/cpphash.c
gcc/cppinit.c

index 0851930..658d776 100644 (file)
@@ -1,5 +1,14 @@
 2000-03-12  Zack Weinberg  <zack@wolery.cumb.org>
 
+       * 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.
+
+2000-03-12  Zack Weinberg  <zack@wolery.cumb.org>
+
        Convert cpplib to use libiberty/hashtab.c.
 
        * cpplib.h (struct cpp_reader): Make hashtab and
index 964a589..9fff80b 100644 (file)
@@ -2049,7 +2049,7 @@ cppulp.o:   cppulp.c   $(CONFIG_H) system.h output.h
 cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
 cppexp.o:   cppexp.c   $(CONFIG_H) $(LIBCPP_DEPS)
 cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H)
-cpphash.o:  cpphash.c  $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) version.h
+cpphash.o:  cpphash.c  $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H)
 cpplib.o:   cpplib.c   $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h
 
 cppinit.o:  cppinit.c  $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h \
index f993510..3d48e8c 100644 (file)
@@ -28,7 +28,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #include "cpplib.h"
 #include "cpphash.h"
 #include "hashtab.h"
-#include "version.h"
 #undef abort
 
 static unsigned int hash_HASHNODE PARAMS ((const void *));
@@ -876,10 +875,10 @@ special_symbol (hp, pfile)
       }
 
     case T_VERSION:
-      len = strlen (version_string);
+      len = strlen (hp->value.cpval);
       CPP_RESERVE (pfile, 3 + len);
       CPP_PUTC_Q (pfile, '"');
-      CPP_PUTS_Q (pfile, version_string, len);
+      CPP_PUTS_Q (pfile, hp->value.cpval, len);
       CPP_PUTC_Q (pfile, '"');
       CPP_NUL_TERMINATE_Q (pfile);
       return;
index f6fd246..0eb2a29 100644 (file)
@@ -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