OSDN Git Service

2000-04-17 Bryce McKinlay <bryce@albatross.co.nz>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Apr 2000 17:27:45 +0000 (17:27 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Apr 2000 17:27:45 +0000 (17:27 +0000)
* gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
with a newline, for CNI.
(print_stub_or_jni): Print a space or newline before method name for
CNI as well as JNI.
(print_cxx_classname): Don't write leading "::" in CNI stub method.
(process_file): Include gcj/cni.h if generating CNI stubs.

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

gcc/java/ChangeLog
gcc/java/gjavah.c

index cf4728b..5215ce0 100644 (file)
@@ -1,3 +1,12 @@
+2000-04-17  Bryce McKinlay  <bryce@albatross.co.nz>
+
+       * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names 
+       with a newline, for CNI.
+       (print_stub_or_jni): Print a space or newline before method name for 
+       CNI as well as JNI.
+       (print_cxx_classname): Don't write leading "::" in CNI stub method.
+       (process_file): Include gcj/cni.h if generating CNI stubs.      
+
 2000-04-16  Tom Tromey  <tromey@cygnus.com>
 
        * gjavah.c (decompile_method): Use print_field_name.
index 436553c..355f99c 100644 (file)
@@ -1122,7 +1122,7 @@ DEFUN (print_name_for_stub_or_jni, (stream, jcf, name_index, signature_index,
        AND int name_index AND int signature_index
        AND int is_init AND const char *name_override AND int flags)
 {
-  const char *const prefix = flag_jni ? "Java_" : "\n";
+  const char *const prefix = flag_jni ? "Java_" : "";
   print_cxx_classname (stream, prefix, jcf, jcf->this_class);
   fputs (flag_jni ? "_" : "::", stream);
   print_full_cxx_name (stream, jcf, name_index, 
@@ -1188,9 +1188,8 @@ DEFUN(print_stub_or_jni, (stream, jcf, name_index, signature_index, is_init,
 
       /* When printing a JNI header we need to respect the space.  In
         other cases we're just going to insert a newline anyway.  */
-      if (flag_jni)
-       fputs (need_space && ! stubs ? " " : "\n", stream);
-
+      fputs (need_space && ! stubs ? " " : "\n", stream);
+      
       /* Now print the name of the thing.  */
       print_name_for_stub_or_jni (stream, jcf, name_index,
                                  signature_index, is_init, name_override,
@@ -1251,7 +1250,7 @@ print_cxx_classname (stream, prefix, jcf, index)
   fputs (prefix, stream);
 
   /* Print a leading "::" so we look in the right namespace.  */
-  if (! flag_jni)
+  if (! flag_jni && ! stubs)
     fputs ("::", stream);
 
   while (s < limit)
@@ -1691,6 +1690,7 @@ DEFUN(process_file, (jcf, out),
          if (len > 6 && ! strcmp (&jcf->classname[len - 6], ".class"))
            len -= 6;
          print_include (out, jcf->classname, len);
+         print_include (out, "gcj/cni", -1);
        }
     }