File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
- // swift-tools-version:5.6
1
+ // swift-tools-version:5.5
2
2
3
3
import PackageDescription
4
4
import Foundation
@@ -142,9 +142,11 @@ let package = Package(
142
142
]
143
143
)
144
144
145
- // If `SWIFTCI_USE_LOCAL_DEPS` is set, we are in a CI enviornment that might disallow
145
+ #if swift(>=5.6)
146
+ // If `SWIFTCI_USE_LOCAL_DEPS` is set, we are in a CI enviornment that might disallow
146
147
// internet access, so we can't load swift-docc-plugin. Simply don't load it in these
147
148
// environments because we don't build docc in CI at the moment.
148
149
if ProcessInfo . processInfo. environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
149
150
package . dependencies. append ( . package ( url: " https://github.com/apple/swift-docc-plugin " , from: " 1.0.0 " ) )
150
151
}
152
+ #endif
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ public class BumpPtrAllocator {
119
119
/// Check if the address is managed by this allocator.
120
120
public func contains( address: UnsafeRawPointer ) -> Bool {
121
121
func test( _ slab: Slab ) -> Bool {
122
- slab. baseAddress! <= address && address < slab. baseAddress! + slab. count
122
+ UnsafeRawPointer ( slab. baseAddress!) <= address && address < UnsafeRawPointer ( slab. baseAddress!) + slab. count
123
123
}
124
124
return slabs. contains ( where: test ( _: ) ) || customSizeSlabs. contains ( where: test ( _: ) )
125
125
}
@@ -145,3 +145,24 @@ public class BumpPtrAllocator {
145
145
_totalBytesAllocated
146
146
}
147
147
}
148
+
149
+ // MARK: Compatibilty Shims
150
+
151
+ #if swift(<5.7)
152
+ extension UnsafeMutableRawPointer {
153
+ /// Obtain the next pointer whose bit pattern is a multiple of alignment.
154
+ ///
155
+ /// - Parameter alignment: The alignment of the returned pointer, in bytes.
156
+ /// Alignment must be a whole power of 2.
157
+ /// - Returns: A pointer aligned to `alignment`.
158
+ fileprivate func alignedUp( toMultipleOf alignment: Int ) -> Self {
159
+ let mask = UInt ( alignment) &- 1
160
+ assert (
161
+ alignment > 0 && UInt ( alignment) & mask == 0 ,
162
+ " alignment must be a whole power of 2. "
163
+ )
164
+ let bits = ( UInt ( bitPattern: self ) &+ mask) & ~ mask
165
+ return . init( bitPattern: bits) !
166
+ }
167
+ }
168
+ #endif
You can’t perform that action at this time.
0 commit comments