Add extern "C" to JNI definitions to catch mismatches.

This commit is contained in:
Peter Johnson
2015-11-01 07:44:43 -08:00
parent b793810e4a
commit 9200b7c78c

View File

@@ -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"