This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: CNI headers -vs- interfaces
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 27 Apr 2005 11:28:19 -0600
- Subject: [gcjx] Patch: FYI: CNI headers -vs- interfaces
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
In a CNI header we must show 'Object' as the superclass for an
interface, and we must emit the 'java_interface' attribute.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* header/cni.cc (generate): Superclass of interface is Object.
Emit attribute for java interface.
Index: header/cni.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/header/Attic/cni.cc,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 cni.cc
--- header/cni.cc 17 Apr 2005 21:26:14 -0000 1.1.2.7
+++ header/cni.cc 27 Apr 2005 17:27:40 -0000
@@ -617,6 +617,8 @@
out << "class " << cxxname (klass, false);
if (klass->get_superclass ())
out << " : public ::" << cxxname (klass->get_superclass (), false);
+ else
+ out << " : public ::java::lang::Object";
out << std::endl;
out << "{" << std::endl;
@@ -656,7 +658,11 @@
out << " static ::java::lang::Class class$;" << std::endl;
- out << "};" << std::endl
+ out << "}";
+ if (klass->interface_p ())
+ out << " __attribute__ ((__java_interface__))";
+
+ out << ";" << std::endl
<< std::endl;
emit_actions (out, CNI_APPEND, actions);