mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: Use config directives to work without objective-c.
Swift SVN r23211
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
import SwiftShims
|
||||
|
||||
/// Return true iff the given `index` is valid as a position, i.e. `0
|
||||
@@ -218,11 +219,16 @@ extension _SwiftNativeNSArrayWithContiguousStorage: _NSArrayCoreType {
|
||||
?? _nativeStorage._getNonVerbatimBridgedCount()
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Empty shim version for non-objc platforms.
|
||||
class _SwiftNativeNSArrayWithContiguousStorage {}
|
||||
#endif
|
||||
|
||||
/// Base class of the heap buffer backing arrays.
|
||||
internal class _ContiguousArrayStorageBase
|
||||
: _SwiftNativeNSArrayWithContiguousStorage {
|
||||
|
||||
#if _runtime(_ObjC)
|
||||
internal override func withUnsafeBufferOfObjects<R>(
|
||||
body: (UnsafeBufferPointer<AnyObject>)->R
|
||||
) -> R {
|
||||
@@ -253,6 +259,7 @@ internal class _ContiguousArrayStorageBase
|
||||
_sanityCheckFailure(
|
||||
"Concrete subclasses must implement _getNonVerbatimBridgedHeapBuffer")
|
||||
}
|
||||
#endif
|
||||
|
||||
func canStoreElementsOfDynamicType(_: Any.Type) -> Bool {
|
||||
_sanityCheckFailure(
|
||||
|
||||
Reference in New Issue
Block a user