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
138
138
{
139
139
::JNINativeMethod Unwrap (JNINativeMethod<R (JNIEnv*, T*, Args...)> method) const
140
140
{
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 ) };
142
142
}
143
143
};
144
144
Original file line number Diff line number Diff line change 1
1
#include < jni/types.hpp>
2
2
3
+ #ifdef _JAVASOFT_JNI_H_
4
+ using JNINativeInterface = JNINativeInterface_;
5
+ #endif
6
+
3
7
template < class T >
4
8
struct Testable
5
9
{
@@ -12,8 +16,9 @@ struct Testable
12
16
struct TestEnv : public jni ::JNIEnv
13
17
{
14
18
TestEnv ()
19
+ : jni::JNIEnv { new JNINativeInterface },
20
+ functions (const_cast <JNINativeInterface*>(jni::JNIEnv::functions))
15
21
{
16
- functions = new JNINativeInterface;
17
22
functions->ExceptionCheck = [] (JNIEnv* env) -> jboolean
18
23
{
19
24
return reinterpret_cast <TestEnv*>(env)->exception ? JNI_TRUE : JNI_FALSE;
@@ -23,6 +28,7 @@ struct TestEnv : public jni::JNIEnv
23
28
~TestEnv () { delete functions; }
24
29
25
30
bool exception = false ;
31
+ JNINativeInterface* functions;
26
32
};
27
33
28
34
template < class E , class Fn >
You can’t perform that action at this time.
0 commit comments