From b100e28aff3a36d7eba0924dd5c0f2e74ea9e536 Mon Sep 17 00:00:00 2001
From: mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 28 Dec 2002 06:29:24 +0000
Subject: [PATCH] 	* gjavah.c (print_name_for_stub_or_jni): Adjust call
 to 	print_cxx_classname. 	(print_cxx_classname): Add add_scope
 parameter. 	(print_class_decls): Do not emit a semicolon after the extern 
 "Java" block. 	(process_file): Adjust calls to print_cxx_classname.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60555 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/java/ChangeLog |  9 +++++++++
 gcc/java/gjavah.c  | 16 +++++++++-------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 07285ba81772..7fb17a8b7981 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,12 @@
+2002-12-27  Mark Mitchell  <mark@codesourcery.com>
+
+	* gjavah.c (print_name_for_stub_or_jni): Adjust call to
+	print_cxx_classname.
+	(print_cxx_classname): Add add_scope parameter.
+	(print_class_decls): Do not emit a semicolon after the extern
+	"Java" block.
+	(process_file): Adjust calls to print_cxx_classname.	
+
 2002-12-23  Joseph S. Myers  <jsm@polyomino.org.uk>
 
 	* gcj.texi: Include Cover Texts in man page.
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 9dc11abf3100..b1dc55ffa522 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -122,7 +122,7 @@ static struct method_name *method_name_list;
 
 static void print_field_info PARAMS ((FILE*, JCF*, int, int, JCF_u2));
 static void print_mangled_classname PARAMS ((FILE*, JCF*, const char*, int));
-static int  print_cxx_classname PARAMS ((FILE*, const char*, JCF*, int));
+static int  print_cxx_classname PARAMS ((FILE*, const char*, JCF*, int, int));
 static void print_method_info PARAMS ((FILE*, JCF*, int, int, JCF_u2));
 static void print_c_decl PARAMS ((FILE*, JCF*, int, int, int, const char *,
 				  int));
@@ -1533,7 +1533,7 @@ DEFUN (print_name_for_stub_or_jni, (stream, jcf, name_index, signature_index,
        AND int is_init AND const char *name_override AND int flags)
 {
   const char *const prefix = flag_jni ? "Java_" : "";
-  print_cxx_classname (stream, prefix, jcf, jcf->this_class);
+  print_cxx_classname (stream, prefix, jcf, jcf->this_class, 1);
   fputs (flag_jni ? "_" : "::", stream);
   print_full_cxx_name (stream, jcf, name_index, 
 		       signature_index, is_init, name_override,
@@ -1641,11 +1641,12 @@ DEFUN(print_mangled_classname, (stream, jcf, prefix, index),
    to an array, ignore it and don't print PREFIX.  Returns 1 if
    something was printed, 0 otherwise.  */
 static int
-print_cxx_classname (stream, prefix, jcf, index)
+print_cxx_classname (stream, prefix, jcf, index, add_scope)
      FILE *stream;
      const char *prefix;
      JCF *jcf;
      int index;
+     int add_scope;
 {
   int name_index = JPOOL_USHORT1 (jcf, index);
   int len, c;
@@ -1664,7 +1665,7 @@ print_cxx_classname (stream, prefix, jcf, index)
   fputs (prefix, stream);
 
   /* Print a leading "::" so we look in the right namespace.  */
-  if (! flag_jni && ! stubs)
+  if (! flag_jni && ! stubs && add_scope)
     fputs ("::", stream);
 
   while (s < limit)
@@ -1954,7 +1955,7 @@ print_class_decls (out, jcf, self)
       /* We use an initial offset of 0 because the root namelet
 	 doesn't cause anything to print.  */
       print_namelet (out, &root, 0);
-      fputs ("};\n\n", out);
+      fputs ("}\n\n", out);
     }
 }
 
@@ -2130,7 +2131,8 @@ DEFUN(process_file, (jcf, out),
 
       if (! stubs)
 	{
-	  if (! print_cxx_classname (out, "class ", jcf, jcf->this_class))
+	  if (! print_cxx_classname (out, "class ", jcf,
+				     jcf->this_class, 0))
 	    {
 	      fprintf (stderr, "class is of array type\n");
 	      found_error = 1;
@@ -2139,7 +2141,7 @@ DEFUN(process_file, (jcf, out),
 	  if (jcf->super_class)
 	    {
 	      if (! print_cxx_classname (out, " : public ", 
-					 jcf, jcf->super_class))
+					 jcf, jcf->super_class, 1))
 		{
 		  fprintf (stderr, "base class is of array type\n");
 		  found_error = 1;
-- 
GitLab