aboutsummaryrefslogtreecommitdiffstats
path: root/sample-java/src/main/cpp/jni_onload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sample-java/src/main/cpp/jni_onload.cpp')
-rw-r--r--sample-java/src/main/cpp/jni_onload.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/sample-java/src/main/cpp/jni_onload.cpp b/sample-java/src/main/cpp/jni_onload.cpp
new file mode 100644
index 0000000..ff05c43
--- /dev/null
+++ b/sample-java/src/main/cpp/jni_onload.cpp
@@ -0,0 +1,23 @@
+/**
+* <pre>
+* Author: landerlyoung@gmail.com
+* Date: 2019-09-26
+* Time: 15:32
+* Life with Passion, Code with Creativity.
+* </pre>
+*/
+
+#include <jni.h>
+#include <cassert>
+#include "ComputeInNative.h"
+
+JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {
+ JNIEnv *env;
+ if (vm->GetEnv(reinterpret_cast<void**>(&env),
+ JNI_VERSION_1_6) != JNI_OK) {
+ return -1;
+ }
+ assert(ComputeInNative::registerNativeFunctions(env));
+ return JNI_VERSION_1_6;
+}
+