stdlib: Use config directives to work without objective-c.

Swift SVN r23211
This commit is contained in:
Graham Batty
2014-11-10 20:06:25 +00:00
parent 98586b32e5
commit dc6a776d10
27 changed files with 290 additions and 18 deletions

View File

@@ -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(