Skip to content

Commit

Permalink
Fix Swift 5.9 compilation warnings
Browse files Browse the repository at this point in the history
Needs Sendability on Linux.
  • Loading branch information
helje5 committed Jun 18, 2024
1 parent 3d1ad7f commit bccc87c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Plugins/Libraries/LighterGeneration/SchemaLoader.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
//
// Created by Helge Heß.
// Copyright © 2022 ZeeZide GmbH.
// Copyright © 2022-2024 ZeeZide GmbH.
//

import SQLite3
import SQLite3Schema
import Foundation
#if !(os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && swift(>=5.9)
@preconcurrency import Foundation
#else
import class Foundation.FileManager
import struct Foundation.URL
#endif

/**
* A helper class that can load schemas from SQLite database *and* a set of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ZeeQL3
//
// Created by Helge Hess on 19/05/17.
// Copyright © 2017-2022 ZeeZide GmbH. All rights reserved.
// Copyright © 2017-2024 ZeeZide GmbH. All rights reserved.
//

import struct Foundation.CharacterSet
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Created by Helge Heß.
// Copyright © 2024 ZeeZide GmbH.
//


#if !(os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && swift(>=5.9)
#if compiler(<6) // seems necessary?
import struct Foundation.CharacterSet
import class Foundation.DateFormatter
extension CharacterSet : @unchecked Sendable {}
extension DateFormatter : @unchecked Sendable {}
#endif
#endif
3 changes: 2 additions & 1 deletion Sources/Lighter/Schema/SQLiteValueType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

import SQLite3
#if canImport(Foundation)
#if !(os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && swift(>=5.10)
#if !(os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && swift(>=5.9)
@preconcurrency import Foundation
#if compiler(<6) // seems necessary?
extension Date : @unchecked Sendable {}
extension Decimal : @unchecked Sendable {}
extension Locale : @unchecked Sendable {}
extension URL : @unchecked Sendable {}
Expand Down

0 comments on commit bccc87c

Please sign in to comment.