mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add extern "C" to JNI definitions to catch mismatches.
This commit is contained in:
@@ -19,6 +19,8 @@ static jclass entryInfoCls = nullptr;
|
||||
static jclass keyNotDefinedEx = nullptr;
|
||||
static jclass persistentEx = nullptr;
|
||||
|
||||
extern "C" {
|
||||
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
jvm = vm;
|
||||
|
||||
@@ -89,6 +91,8 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
|
||||
jvm = nullptr;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
//
|
||||
// Helper class to automatically clean up a local reference
|
||||
//
|
||||
@@ -376,6 +380,8 @@ static void ThrowTableKeyNotDefined(JNIEnv *env, jstring key) {
|
||||
env->Throw(static_cast<jthrowable>(exception));
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_wpilibj_networktables_NetworkTablesJNI
|
||||
* Method: containsKey
|
||||
@@ -1232,3 +1238,5 @@ done:
|
||||
},
|
||||
minLevel);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user