java_jni/fix: fix ABI for JNI_On Load | Unload
@@ -269,7 +269,7 @@ pub(in crate::java_jni) fn generate_load_unload_jni_funcs(
let jni_load_func: syn::Item = parse_quote! {
#[no_mangle]
- pub extern "C" fn JNI_OnLoad(java_vm: *mut JavaVM, _reserved: *mut ::std::os::raw::c_void) -> jint {
+ pub extern "system" fn JNI_OnLoad(java_vm: *mut JavaVM, _reserved: *mut ::std::os::raw::c_void) -> jint {
println!("JNI_OnLoad begin");
assert!(!java_vm.is_null());
let mut env: *mut JNIEnv = ::std::ptr::null_mut();
@@ -292,7 +292,7 @@ pub(in crate::java_jni) fn generate_load_unload_jni_funcs(
addon_code.push(jni_load_func);
let jni_unload_func: syn::Item = parse_quote! {
#[no_mangle]
- pub extern "C" fn JNI_OnUnload(java_vm: *mut JavaVM, _reserved: *mut ::std::os::raw::c_void) {
+ pub extern "system" fn JNI_OnUnload(java_vm: *mut JavaVM, _reserved: *mut ::std::os::raw::c_void) {
println!("JNI_OnUnLoad begin");
assert!(!java_vm.is_null());
let mut env: *mut JNIEnv = ::std::ptr::null_mut();
