Skip to content

Commit 4dc10f0

Browse files
committed
JavaKit: Fixed Android support
1 parent 2c8c9b2 commit 4dc10f0

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

Sources/JavaKit/JavaEnvironment.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
import JavaRuntime
1616

17-
#if canImport(Android)
18-
typealias JNINativeInterface_ = JNINativeInterface
19-
#endif
20-
2117
extension UnsafeMutablePointer<JNIEnv?> {
2218
var interface: JNINativeInterface_ { self.pointee!.pointee }
2319
}

Sources/JavaKit/JavaKitVM/JavaVirtualMachine.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ import Foundation
1919
#endif
2020

2121
public typealias JavaVMPointer = UnsafeMutablePointer<JavaVM?>
22-
#if canImport(Android)
23-
typealias JNIEnvPointer = UnsafeMutablePointer<JNIEnv?>
24-
#else
2522
typealias JNIEnvPointer = UnsafeMutableRawPointer
26-
#endif
2723

2824
public final class JavaVirtualMachine: @unchecked Sendable {
2925
/// The JNI version that we depend on.
@@ -166,11 +162,7 @@ extension JavaVirtualMachine {
166162
return environment.assumingMemoryBound(to: JNIEnv?.self)
167163
}
168164

169-
#if canImport(Android)
170-
var jniEnv = environment?.assumingMemoryBound(to: JNIEnv?.self)
171-
#else
172165
var jniEnv = environment
173-
#endif
174166

175167
// Attach the current thread to the JVM.
176168
let attachResult: jint
@@ -188,11 +180,7 @@ extension JavaVirtualMachine {
188180

189181
JavaVirtualMachine.destroyTLS.set(jniEnv!)
190182

191-
#if canImport(Android)
192-
return jniEnv!
193-
#else
194183
return jniEnv!.assumingMemoryBound(to: JNIEnv?.self)
195-
#endif
196184
}
197185

198186
/// Detach the current thread from the Java Virtual Machine. All Java

0 commit comments

Comments
 (0)