File tree Expand file tree Collapse file tree 5 files changed +5
-20
lines changed Expand file tree Collapse file tree 5 files changed +5
-20
lines changed Original file line number Diff line number Diff line change 128128/*
129129 * Define to 1 if you want extra aligned types in libbson
130130 */
131- #define BSON_EXTRA_ALIGN 1
131+ #define BSON_EXTRA_ALIGN 0
132132#if BSON_EXTRA_ALIGN != 1
133133# undef BSON_EXTRA_ALIGN
134134#endif
Original file line number Diff line number Diff line change 11import CLibMongoC
22import Foundation
33
4- #if compiler(>=5.0)
5- internal typealias BSONPointer = OpaquePointer
6- internal typealias MutableBSONPointer = OpaquePointer
7- #else
84internal typealias BSONPointer = UnsafePointer < bson_t >
95internal typealias MutableBSONPointer = UnsafeMutablePointer < bson_t >
10- #endif
116
127/// The storage backing a MongoSwift `Document`.
138public class DocumentStorage {
@@ -55,11 +50,7 @@ public struct Document {
5550extension Document {
5651 /// Read-only access to the storage's underlying bson_t.
5752 internal var _bson : BSONPointer {
58- #if compiler(>=5.0)
59- return self . _storage. _bson
60- #else
61- return UnsafePointer ( self . _storage. _bson)
62- #endif
53+ UnsafePointer ( self . _storage. _bson)
6354 }
6455
6556 /**
Original file line number Diff line number Diff line change 11import CLibMongoC
22import Foundation
33
4- #if compiler(>=5.0)
5- internal typealias BSONIterPointer = OpaquePointer
6- internal typealias MutableBSONIterPointer = OpaquePointer
7- #else
84internal typealias BSONIterPointer = UnsafePointer < bson_iter_t >
95internal typealias MutableBSONIterPointer = UnsafeMutablePointer < bson_iter_t >
10- #endif
116
127/// An iterator over the values in a `Document`.
138public class DocumentIterator : IteratorProtocol {
Original file line number Diff line number Diff line change @@ -115,14 +115,13 @@ internal class ConnectionString {
115115 internal var authMechanismProperties : Document ? {
116116 var props = bson_t ( )
117117 return withUnsafeMutablePointer ( to: & props) { propsPtr in
118- let opaquePtr = OpaquePointer ( propsPtr)
119- guard mongoc_uri_get_mechanism_properties ( self . _uri, opaquePtr) else {
118+ guard mongoc_uri_get_mechanism_properties ( self . _uri, propsPtr) else {
120119 return nil
121120 }
122121 /// This copy should not be returned directly as its only guaranteed valid for as long as the
123122 /// `mongoc_uri_t`, as `props` was statically initialized from data stored in the URI and may contain
124123 /// pointers that will be invalidated once the URI is.
125- let copy = Document ( copying: opaquePtr )
124+ let copy = Document ( copying: propsPtr )
126125
127126 return copy. mapValues { value in
128127 // mongoc returns boolean options e.g. CANONICALIZE_HOSTNAME as strings, but they are boolean values.
Original file line number Diff line number Diff line change 128128/*
129129 * Define to 1 if you want extra aligned types in libbson
130130 */
131- #define BSON_EXTRA_ALIGN 1
131+ #define BSON_EXTRA_ALIGN 0
132132#if BSON_EXTRA_ALIGN != 1
133133# undef BSON_EXTRA_ALIGN
134134#endif
You can’t perform that action at this time.
0 commit comments