Skip to content

Commit 8d3f82d

Browse files
committed
Attempt to fix issues in Swift 5.9
1 parent 3f08cf3 commit 8d3f82d

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Sources/InterposeKit/Hooks/HookStrategy/ObjectHookStrategy/ObjectHookRegistry.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ internal enum ObjectHookRegistry {
3434

3535
}
3636

37+
#if compiler(>=5.10)
3738
fileprivate nonisolated(unsafe) var ObjectHookRegistryKey: UInt8 = 0
39+
#else
40+
fileprivate var ObjectHookRegistryKey: UInt8 = 0
41+
#endif
3842

3943
fileprivate class WeakReference<T: AnyObject>: NSObject {
4044

Sources/InterposeKit/Hooks/HookStrategy/ObjectHookStrategy/ObjectHookStrategy.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,4 +294,8 @@ extension NSObject {
294294

295295
}
296296

297-
private nonisolated(unsafe) var ObjectHookCountKey: UInt8 = 0
297+
#if compiler(>=5.10)
298+
fileprivate nonisolated(unsafe) var ObjectHookCountKey: UInt8 = 0
299+
#else
300+
fileprivate var ObjectHookCountKey: UInt8 = 0
301+
#endif

Sources/InterposeKit/Interpose.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ public enum Interpose {
9090
///
9191
/// It is recommended to set this flag only once early in your application lifecycle,
9292
/// e.g. at app startup or in test setup.
93+
#if compiler(>=5.10)
9394
public nonisolated(unsafe) static var isLoggingEnabled = false
95+
#else
96+
public static var isLoggingEnabled = false
97+
#endif
9498

9599
internal nonisolated static func log(
96100
_ message: @autoclosure () -> String

0 commit comments

Comments
 (0)