This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Bug in JNI RegisterNatives?
>>>>> "Juerg" == Juerg Lehni <juerg@scratchdisk.com> writes:
Juerg> I just tried to do this but was running into troubles with needed
Juerg> forward declarations in Class.h for JNIEnv and JNINativeMethod, both
Juerg> needed to declare _Jv_JNI_RegisterNatives as a friend.
Juerg> The way these are defined in jni.h, it seems to not be possible to
Juerg> forward declare them in Class.h. A possible solution is to include
Juerg> jni.h there, but before I go ahead I'd like to hear your opinion on
Juerg> this.
You shouldn't need to. You can just declare them like:
struct JNIEnv;
struct JNINativeMethod;
in Class.h.
In fact, JNIEnv must already be handled this way, since it is already
referred to in Class.h.
Tom