Tony Parker ec730c21f0
Build swift-corelibs-foundation as a package on top of swift-foundation (#514)
* Provide public access for some internal functions, to enable swift-corelibs-foundation

* Add access to TimeZone internals for swift-corelibs-foundation

* Fix default TimeZone for Linux

* Remove unneeded private entry point

* Do not use a recursive definition of description for String.Encoding

* Merge in some WASI changes and other Data fixes

* Add temporary initializer to the stub URL

* Remove Hashable conformance for CocoaError. This allows userInfo to be Any instead of AnyHashable

* Remove some protocols which depend on NSError from swift-foundation -- they will live in swift-corelibs-foundation

* Adjust the debug description of the GMT ICU calendar to be a little less implementation-specific

* Use an English-only description for string encodings, for compatibility with existing SCL-F clients

* Use a more compatible definition of a backstop value for Bundle
2024-03-28 14:55:31 -07:00

28 lines
900 B
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#if FOUNDATION_FRAMEWORK
// For Logger
internal import os
internal import _ForSwiftFoundation
internal import _CShims
#endif
internal func logFileIOErrno(_ err: Int32, at place: String) {
#if FOUNDATION_FRAMEWORK
#if !os(bridgeOS)
let errnoDesc = String(cString: strerror(err))
Logger(_NSOSLog()).error("Encountered \(place) failure \(err) \(errnoDesc)")
#endif
#endif
}