diff --git a/GRDB/Core/StatementAuthorizer.swift b/GRDB/Core/StatementAuthorizer.swift index e20883049f..c746c2119e 100644 --- a/GRDB/Core/StatementAuthorizer.swift +++ b/GRDB/Core/StatementAuthorizer.swift @@ -1,5 +1,7 @@ #if os(Linux) import Glibc +#elseif os(Windows) +import ucrt #endif /// `StatementAuthorizer` provides information about compiled database diff --git a/GRDB/Core/Support/Foundation/NSNumber.swift b/GRDB/Core/Support/Foundation/NSNumber.swift index 9867e8f43f..1c5778c19e 100644 --- a/GRDB/Core/Support/Foundation/NSNumber.swift +++ b/GRDB/Core/Support/Foundation/NSNumber.swift @@ -1,4 +1,4 @@ -#if !os(Linux) +#if !os(Linux) && !os(Windows) import Foundation private let integerRoundingBehavior = NSDecimalNumberHandler( diff --git a/GRDB/Core/Support/Foundation/URL.swift b/GRDB/Core/Support/Foundation/URL.swift index cf4b96d120..134684c89f 100644 --- a/GRDB/Core/Support/Foundation/URL.swift +++ b/GRDB/Core/Support/Foundation/URL.swift @@ -1,14 +1,14 @@ import Foundation -#if !os(Linux) +#if !os(Linux) && !os(Windows) /// NSURL stores its absoluteString in the database. extension NSURL: DatabaseValueConvertible { - + /// Returns a TEXT database value containing the absolute URL. public var databaseValue: DatabaseValue { absoluteString?.databaseValue ?? .null } - + public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self? { guard let string = String.fromDatabaseValue(dbValue) else { return nil diff --git a/GRDB/Core/Support/Foundation/UUID.swift b/GRDB/Core/Support/Foundation/UUID.swift index 8aa88d0901..642d8d6f02 100644 --- a/GRDB/Core/Support/Foundation/UUID.swift +++ b/GRDB/Core/Support/Foundation/UUID.swift @@ -1,6 +1,6 @@ import Foundation -#if !os(Linux) +#if !os(Linux) && !os(Windows) /// NSUUID adopts DatabaseValueConvertible extension NSUUID: DatabaseValueConvertible { /// Returns a BLOB database value containing the uuid bytes. @@ -11,7 +11,7 @@ extension NSUUID: DatabaseValueConvertible { return NSData(bytes: buffer.baseAddress, length: 16).databaseValue } } - + /// Returns a `NSUUID` from the specified database value. /// /// If the database value contains a string, parses this string as an uuid. @@ -43,7 +43,7 @@ extension UUID: DatabaseValueConvertible { Data(bytes: $0.baseAddress!, count: $0.count).databaseValue } } - + /// Returns a `UUID` from the specified database value. /// /// If the database value contains a string, parses this string as an uuid. diff --git a/Package.swift b/Package.swift index dfd0d59fad..16db0bcaa6 100644 --- a/Package.swift +++ b/Package.swift @@ -48,6 +48,7 @@ let package = Package( targets: [ .systemLibrary( name: "CSQLite", + pkgConfig: "sqlite3", providers: [.apt(["libsqlite3-dev"])]), .target( name: "GRDB",