Skip to content

Add #if os(macOS) check to _loadScopeAttributes #3060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/Foundation/AttributedString/Conversion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ internal func _loadDefaultAttributes() -> [String : Any.Type] {

@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
fileprivate func _loadScopeAttributes(forSymbol symbol: String, from path: String) -> [String : Any.Type]? {
#if os(macOS)
_loadedScopeCacheLock.lock()
defer { _loadedScopeCacheLock.unlock() }
if let cachedResult = _loadedScopeCache[symbol] {
Expand All @@ -302,6 +303,9 @@ fileprivate func _loadScopeAttributes(forSymbol symbol: String, from path: Strin
let attributeTypes = _loadAttributeTypes(from: scopeType)
_loadedScopeCache[symbol] = attributeTypes
return attributeTypes
#else
return nil
#endif // os(macOS)
}

@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
Expand Down