File tree Expand file tree Collapse file tree 2 files changed +0
-16
lines changed Expand file tree Collapse file tree 2 files changed +0
-16
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import JavaRuntime
16
16
17
- #if canImport(Android)
18
- typealias JNINativeInterface_ = JNINativeInterface
19
- #endif
20
-
21
17
extension UnsafeMutablePointer < JNIEnv ? > {
22
18
var interface : JNINativeInterface_ { self . pointee!. pointee }
23
19
}
Original file line number Diff line number Diff line change @@ -19,11 +19,7 @@ import Foundation
19
19
#endif
20
20
21
21
public typealias JavaVMPointer = UnsafeMutablePointer < JavaVM ? >
22
- #if canImport(Android)
23
- typealias JNIEnvPointer = UnsafeMutablePointer < JNIEnv ? >
24
- #else
25
22
typealias JNIEnvPointer = UnsafeMutableRawPointer
26
- #endif
27
23
28
24
public final class JavaVirtualMachine : @unchecked Sendable {
29
25
/// The JNI version that we depend on.
@@ -166,11 +162,7 @@ extension JavaVirtualMachine {
166
162
return environment. assumingMemoryBound ( to: JNIEnv ? . self)
167
163
}
168
164
169
- #if canImport(Android)
170
- var jniEnv = environment? . assumingMemoryBound ( to: JNIEnv ? . self)
171
- #else
172
165
var jniEnv = environment
173
- #endif
174
166
175
167
// Attach the current thread to the JVM.
176
168
let attachResult : jint
@@ -188,11 +180,7 @@ extension JavaVirtualMachine {
188
180
189
181
JavaVirtualMachine . destroyTLS. set ( jniEnv!)
190
182
191
- #if canImport(Android)
192
- return jniEnv!
193
- #else
194
183
return jniEnv!. assumingMemoryBound ( to: JNIEnv ? . self)
195
- #endif
196
184
}
197
185
198
186
/// Detach the current thread from the Java Virtual Machine. All Java
You can’t perform that action at this time.
0 commit comments