mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
New 2018 and later build setup (#1001)
This commit is contained in:
committed by
Peter Johnson
parent
cb2c9eb6d5
commit
7f88cf768d
23
hal/src/main/native/sim/jni/jnishim.cpp
Normal file
23
hal/src/main/native/sim/jni/jnishim.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// This will be removed when new sim is added in
|
||||
#include <jni.h>
|
||||
|
||||
static JavaVM* jvm = nullptr;
|
||||
|
||||
namespace sim {
|
||||
jint SimOnLoad(JavaVM* vm, void* reserved) {
|
||||
jvm = vm;
|
||||
|
||||
JNIEnv *env;
|
||||
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return JNI_ERR;
|
||||
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
void SimOnUnload(JavaVM * vm, void* reserved) {
|
||||
JNIEnv *env;
|
||||
if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return;
|
||||
jvm = nullptr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user