Conflicting JNI function decls
Danny Smith
dannysmith@clear.net.nz
Wed Aug 4 19:32:00 GMT 2004
Moving discussion from java@
----- Original Message -----
From: "Tom Tromey"
| >>>>> "Danny" == Danny Smith <dannysmith@clear.net.nz> writes:
|
| Danny> While testing a patch to fix PR c ++/15774 (Conflicting
| Danny> function decls not diagnosed) I get this in libjava build.
| Danny> ../../../gcc/libjava/jni.cc:
| Danny> In function `java::lang::Object*
_Jv_JNI_ToReflectedField(JNIEnv*,
| Danny> java::lang::Class*, _Jv_Field*, jboolean)'
| Danny> : ../../../gcc/libjava/jni.cc:1612: error: new declaration
| Danny> `java::lang::Object* _Jv_JNI_ToReflectedField(JNIEnv*,
| Danny> java::lang::Class*, _Jv_Field*, jboolean)'
|
| This is just an oversight on our part. These friend declarations are
| added by some code in Makefile.am -- care to take a stab at fixing
| them? It might involve a little rearrangement since now Field.h will
| probably need to refer to jni.h.
Hi
Bryce suggested that the friend declarations were the real problem, but
I don't have enough famliarity with Java to even try to remove the
friendship relationship between the _Jv_JNI_ToReflected* functions and
the four classes that currently declare them.
This moves definition of JNICALL to gcj/javaprims.h. Pedantically, it
may not belong here, but if Java classes have JNI friends, the interface
does
need to be honest about how those friends pop the stack. Putting it here
avoids include jni.h "all over the place".
Should the define of JNICALL instead be autoconfiscated into
libgcj-config,h?
Patch attached.
Danny
ChangeLog
2004-08-03 Danny Smith <dannysmith@users.sourceforge.net>
* Makefile.am (java/lang/reflect/Constructor.h): Add JNICALL
attribute to _Jv_JNI_ToRefected* friend declaration.
(java/lang/reflect/Field.h) Likewise.
(java/lang/reflect/Method.h): Likewise.
* Makefile.in: Regenerate.
* gcj/javaprims.h: Define JNICALL.
* jni.h: Define JNICALL only if !__GCJ_JNI_IMPL__.
* java/lang/Class.h (_Jv_JNI_ToReflectedField): Add JNICALL
attribute.
(_Jv_JNI_ToReflectedMethod): Add JNICALL attribute.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jnicall-2.diff
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040804/edd95c02/attachment.ksh>
More information about the Java-patches
mailing list