File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ namespace jni
138138 {
139139 ::JNINativeMethod Unwrap (JNINativeMethod<R (JNIEnv*, T*, Args...)> method) const
140140 {
141- return { method.name , method.signature , reinterpret_cast <void *>(method.fnPtr ) };
141+ return { const_cast < char *>( method.name ), const_cast < char *>( method.signature ) , reinterpret_cast <void *>(method.fnPtr ) };
142142 }
143143 };
144144
Original file line number Diff line number Diff line change 11#include < jni/types.hpp>
22
3+ #ifdef _JAVASOFT_JNI_H_
4+ using JNINativeInterface = JNINativeInterface_;
5+ #endif
6+
37template < class T >
48struct Testable
59 {
@@ -12,8 +16,9 @@ struct Testable
1216struct TestEnv : public jni ::JNIEnv
1317 {
1418 TestEnv ()
19+ : jni::JNIEnv { new JNINativeInterface },
20+ functions (const_cast <JNINativeInterface*>(jni::JNIEnv::functions))
1521 {
16- functions = new JNINativeInterface;
1722 functions->ExceptionCheck = [] (JNIEnv* env) -> jboolean
1823 {
1924 return reinterpret_cast <TestEnv*>(env)->exception ? JNI_TRUE : JNI_FALSE;
@@ -23,6 +28,7 @@ struct TestEnv : public jni::JNIEnv
2328 ~TestEnv () { delete functions; }
2429
2530 bool exception = false ;
31+ JNINativeInterface* functions;
2632 };
2733
2834template < class E , class Fn >
You can’t perform that action at this time.
0 commit comments