Closed Bug 333420 Opened 15 years ago Closed 15 years ago
Can't build with gcj
When trying to build with gcj 4.0, I get the following error: ./../nsJavaXPCOMBindingUtils.cpp: In member function 'nsresult NativeToJavaProxyMap::Remove(JNIEnv*, nsISupports*, const nsIID&)': ./../nsJavaXPCOMBindingUtils.cpp:535: error: invalid conversion from '__jobject* const' to '__jweak*' ./../nsJavaXPCOMBindingUtils.cpp:535: error: initializing argument 1 of 'void _Jv_JNIEnv::DeleteWeakGlobalRef(__jweak*)'
Odd that I don't get this error (or a warning even) on other compilers, since it is clearly going from a const to non-const situation. Try this patch.
A bit different with the patch: ./../nsJavaXPCOMBindingUtils.cpp: In member function 'nsresult NativeToJavaProxyMap::Remove(JNIEnv*, nsISupports*, const nsIID&)': ./../nsJavaXPCOMBindingUtils.cpp:535: error: invalid conversion from '__jobject*' to '__jweak*' (I am not authorized to edit the attachment, though i've been asked review to... bugzilla is... interesting...)
BTW, is there any simple way to test the javaxpcom stuff ? It seems the tests in extensions/java/xpcom/tests don't use the javaxpcomglue and javaxpcom.jar.
Forgot about the static cast; was only doing const cast. Give this a shot.
it builds fine, but i don't know how to test if it works correctly.
Checked in patch to trunk. Marking as fixed for now, but if you have more problems, reopen the bug. Also, I updated some of the TestArray and TestJavaProxy tests on the trunk (although TestArray seems to have some issues). But those should be good enough to tell you if JavaXPCOM is working correctly.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I can confirm that the patch works correctly
You need to log in before you can comment on or make changes to this bug.