Skip to content

Commit

Permalink
fix macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
velicuvlad committed Oct 15, 2024
1 parent 3082d62 commit 1d97907
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Swift/DatabaseConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public struct DatabaseConfiguration {
/// is very safe but it is also dramatically slower.
public var fullSync: Bool = defaultFullSync

#if !TARGET_OS_OSX

#if !os(macOS)
/// Enables or disables memory-mapped I/O. By default, memory-mapped I/O is enabled.
/// Disabling it may affect database performance. Typically, there is no need to modify this setting.
/// - Note: Memory-mapped I/O is always disabled to prevent database corruption on macOS.
Expand All @@ -61,7 +62,11 @@ public struct DatabaseConfiguration {
if let c = config {
self.directory = c.directory
self.fullSync = c.fullSync

#if !os(macOS)
self.mmapEnabled = c.mmapEnabled
#endif

#if COUCHBASE_ENTERPRISE
self.encryptionKey = c.encryptionKey
#endif
Expand All @@ -74,7 +79,11 @@ public struct DatabaseConfiguration {
let config = CBLDatabaseConfiguration()
config.directory = self.directory
config.fullSync = self.fullSync

#if !os(macOS)
config.mmapEnabled = self.mmapEnabled
#endif

#if COUCHBASE_ENTERPRISE
config.encryptionKey = self.encryptionKey?.impl
#endif
Expand Down

0 comments on commit 1d97907

Please sign in to comment.