Index: xml.c
===================================================================
RCS file: /cvsroot/GCC_XML/GCC_XML/xml.c,v
retrieving revision 1.58
diff -u -r1.58 xml.c
--- xml.c	14 Aug 2003 12:41:18 -0000	1.58
+++ xml.c	26 Aug 2003 22:19:04 -0000
@@ -36,12 +36,12 @@
 #include "system.h"
 #include "sys/stat.h"
 
-/* GCC 3.3 and above need these headers here.  The GCC-XML patches for
+/* GCC 3.4 and above need these headers here.  The GCC-XML patches for
    these versions define GCC_XML_GCC_VERSION in config.h instead of
    cp-tree.h, so the macro is available here.  The patches for older
    versions may provide the macro in cp-tree.h, but in that case
    we don't need these headers anyway.  */
-#if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030300)
+#if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030400)
 # include "coretypes.h"
 # include "tm.h"
 #endif
@@ -63,8 +63,8 @@
 #endif
 
 /* Decide how to access base classes.  */
-#if !defined(GCC_XML_GCC_VERSION) || (GCC_XML_GCC_VERSION < 0x030300)
-# define XML_PRE_3_3_TREE_VIA_PUBLIC
+#if !defined(GCC_XML_GCC_VERSION) || (GCC_XML_GCC_VERSION < 0x030400)
+# define XML_PRE_3_4_TREE_VIA_PUBLIC
 #endif
 
 /* A "dump node" corresponding to a particular tree node.  */
@@ -155,7 +155,11 @@
 static const char* xml_get_encoded_string_from_string PARAMS ((const char*));
 static tree xml_get_encoded_identifier_from_string PARAMS ((const char*));
 
+#if defined(GCC_XML_GCC_VERSION) && GCC_XML_GCC_VERSION < 0x030300
 extern int errorcount;
+#else
+#include "diagnostic.h"
+#endif
 
 /* Switch to 1 to enable debugging of dump node selection.  */
 #if 0
@@ -772,7 +776,11 @@
     xml_print_id_attribute (xdi, dn);
     xml_print_name_attribute (xdi, DECL_NAME (ns));
     xml_print_context_attribute (xdi, ns);
+#if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030300)
+    xml_print_attributes_attribute (xdi, DECL_ATTRIBUTES(ns), 0);
+#else
     xml_print_attributes_attribute (xdi, DECL_MACHINE_ATTRIBUTES(ns), 0);
+#endif
     
     /* If complete dump, walk the namespace.  */
     if(dn->complete)
@@ -986,8 +994,13 @@
     xml_print_endline_attribute (xdi, body);
     }
   xml_print_function_extern_attribute (xdi, fd);
+#if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030300)
+  xml_print_attributes_attribute (xdi, DECL_ATTRIBUTES(fd),
+                                  TYPE_ATTRIBUTES(TREE_TYPE(fd)));
+#else
   xml_print_attributes_attribute (xdi, DECL_MACHINE_ATTRIBUTES(fd),
                                   TYPE_ATTRIBUTES(TREE_TYPE(fd)));
+#endif
   
   /* Prepare to iterator through argument list.  */
   arg = DECL_ARGUMENTS (fd);
@@ -1044,7 +1057,11 @@
   xml_print_access_attribute (xdi, vd);
   xml_print_location_attribute (xdi, vd);
   xml_print_extern_attribute (xdi, vd);
+#if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030300)
+  xml_print_attributes_attribute (xdi, DECL_ATTRIBUTES(vd), 0);
+#else
   xml_print_attributes_attribute (xdi, DECL_MACHINE_ATTRIBUTES(vd), 0);
+#endif
   fprintf (xdi->file, "/>\n");
 }
 
@@ -1061,7 +1078,11 @@
   xml_print_type_attribute (xdi, TREE_TYPE (fd), dn->complete);
   xml_print_context_attribute (xdi, fd);
   xml_print_location_attribute (xdi, fd);
+#if defined(GCC_XML_GCC_VERSION) && (GCC_XML_GCC_VERSION >= 0x030300)
+  xml_print_attributes_attribute (xdi, DECL_ATTRIBUTES(fd), 0);
+#else
   xml_print_attributes_attribute (xdi, DECL_MACHINE_ATTRIBUTES(fd), 0);
+#endif
   fprintf (xdi->file, "/>\n");
 }
 
@@ -1152,7 +1173,7 @@
     tree binfo = TYPE_BINFO (rt);
     tree binfos = BINFO_BASETYPES (binfo);
     int n_baselinks = binfos? TREE_VEC_LENGTH (binfos) : 0;
-#if !defined (XML_PRE_3_3_TREE_VIA_PUBLIC)
+#if !defined (XML_PRE_3_4_TREE_VIA_PUBLIC)
     tree accesses = BINFO_BASEACCESSES (binfo);
 #endif
     int i;
@@ -1164,7 +1185,7 @@
       if (base_binfo)
         {
         /* Output this base class.  Default is public access.  */
-#if defined (XML_PRE_3_3_TREE_VIA_PUBLIC)
+#if defined (XML_PRE_3_4_TREE_VIA_PUBLIC)
         const char* access = 0;
         if (TREE_VIA_PUBLIC (base_binfo)) { access = ""; }
         else if (TREE_VIA_PROTECTED (base_binfo)) { access = "protected:"; }
