Conflicting JNI function decls

Danny Smith dannysmith@clear.net.nz
Mon Aug 2 09:28:00 GMT 2004


From: "Tom Tromey"
| 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.
|| Tom

Hi,
Attached patch ensures that the declarations of
_Jv_JNI_ToReflectedMethod in java/lang/Class.h and in generated headers
match the definition (with JNICALL attribute) in jni.cc.
Before I spend anymore time on this track, are there any problems with
including jni.h from the generated headers? I did also try to include
from
java/lang/Class.h and ran into redefinition problems, so I did a local
define of JNICALL there
I am not much of a Java/jni hacker. My motivation here is to fix a
deficiency in C++ frontend so that it diagnoses potentially dangerous
calling convention mismatches.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15774
It happens that jni has such a mismatch, so I can't submit the C++ patch
until the jni decls are fixed.
I have completed build on mingw32 and testsuite is in progress. It may
take awhile to complete, since I'm building on an old Windows box. My
real
computer is at work and I'm on holiday so I would appreciate if someone
could test on other target[s].
Danny
ChangeLog
2004年08月02日 Danny Smith <dannysmith@users.sourceforge.net>
 * Makefile.am (java/lang/reflect/Constructor.h): Add
 -prepend '#include <jni.h>'. Add JNICALL attribute to
 _Jv_JNI_ friend declaration.
 (java/lang/reflect/Field.h) Likewise.
 (java/lang/reflect/Method.h): Likewise.
 * Makefile.in: Regenerate.
 * java/lang/Class.h (JNICALL): Define if necessary.
 (_Jv_JNI_ToReflectedField): Add JNICALL attribute.
 (_Jv_JNI_ToReflectedMethod): Add JNICALL attribute.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jnicall.diff
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040802/05b21e88/attachment.ksh>


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /