Skip to content

Commit

Permalink
Merge pull request #36 from apple/unsupported-library-evolution-fixes
Browse files Browse the repository at this point in the history
Fix build errors with library evolution enabled
  • Loading branch information
lorentey authored Aug 30, 2021
2 parents 8dbc766 + 1d4afa4 commit 59f7fbf
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions Sources/Atomics/AtomicBool.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ${autogenerated_warning()}
import _AtomicsShims

extension Bool: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Bool
@usableFromInline
Expand Down
3 changes: 2 additions & 1 deletion Sources/Atomics/AtomicLazyReference.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2021 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
Expand Down Expand Up @@ -124,6 +124,7 @@ extension UnsafeAtomicLazyReference {
///
/// These values can be set (initialized) exactly once, but read many
/// times.
@_fixed_layout
public class ManagedAtomicLazyReference<Instance: AnyObject> {
/// The value logically stored in an atomic lazy reference value.
public typealias Value = Instance?
Expand Down
2 changes: 2 additions & 0 deletions Sources/Atomics/AtomicStrongReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ internal struct _AtomicReferenceStorage {
}
}

@frozen
public struct AtomicReferenceStorage<Value: AnyObject> {
@usableFromInline
internal var _storage: _AtomicReferenceStorage
Expand Down Expand Up @@ -441,6 +442,7 @@ extension AtomicReferenceStorage: AtomicStorage {
}
}

@frozen
public struct AtomicOptionalReferenceStorage<Instance: AnyObject> {
@usableFromInline
internal var _storage: _AtomicReferenceStorage
Expand Down
3 changes: 2 additions & 1 deletion Sources/Atomics/HighLevelTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2021 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
Expand Down Expand Up @@ -72,6 +72,7 @@ public struct UnsafeAtomic<Value: AtomicValue> {
}

/// A reference type holding an atomic value, with automatic memory management.
@_fixed_layout
public class ManagedAtomic<Value: AtomicValue> {
@usableFromInline
internal var _storage: Value.AtomicRepresentation
Expand Down
3 changes: 2 additions & 1 deletion Sources/Atomics/IntegerConformances.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2021 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
Expand Down Expand Up @@ -30,6 +30,7 @@ import _AtomicsShims
#if !(os(Linux) && arch(x86_64)) || ENABLE_DOUBLEWIDE_ATOMICS
% end
extension ${swiftType}: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = ${swiftType}

Expand Down
1 change: 1 addition & 0 deletions Sources/Atomics/autogenerated/AtomicBool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import _AtomicsShims

extension Bool: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Bool
@usableFromInline
Expand Down
3 changes: 2 additions & 1 deletion Sources/Atomics/autogenerated/AtomicLazyReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2021 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
Expand Down Expand Up @@ -127,6 +127,7 @@ extension UnsafeAtomicLazyReference {
///
/// These values can be set (initialized) exactly once, but read many
/// times.
@_fixed_layout
public class ManagedAtomicLazyReference<Instance: AnyObject> {
/// The value logically stored in an atomic lazy reference value.
public typealias Value = Instance?
Expand Down
3 changes: 2 additions & 1 deletion Sources/Atomics/autogenerated/HighLevelTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2021 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
Expand Down Expand Up @@ -74,6 +74,7 @@ public struct UnsafeAtomic<Value: AtomicValue> {
}

/// A reference type holding an atomic value, with automatic memory management.
@_fixed_layout
public class ManagedAtomic<Value: AtomicValue> {
@usableFromInline
internal var _storage: Value.AtomicRepresentation
Expand Down
13 changes: 12 additions & 1 deletion Sources/Atomics/autogenerated/IntegerConformances.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2021 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
Expand All @@ -20,6 +20,7 @@
import _AtomicsShims

extension Int: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Int

Expand Down Expand Up @@ -512,6 +513,7 @@ extension Int.AtomicRepresentation: AtomicIntegerStorage {
}

extension Int64: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Int64

Expand Down Expand Up @@ -1004,6 +1006,7 @@ extension Int64.AtomicRepresentation: AtomicIntegerStorage {
}

extension Int32: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Int32

Expand Down Expand Up @@ -1496,6 +1499,7 @@ extension Int32.AtomicRepresentation: AtomicIntegerStorage {
}

extension Int16: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Int16

Expand Down Expand Up @@ -1988,6 +1992,7 @@ extension Int16.AtomicRepresentation: AtomicIntegerStorage {
}

extension Int8: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = Int8

Expand Down Expand Up @@ -2480,6 +2485,7 @@ extension Int8.AtomicRepresentation: AtomicIntegerStorage {
}

extension UInt: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = UInt

Expand Down Expand Up @@ -2972,6 +2978,7 @@ extension UInt.AtomicRepresentation: AtomicIntegerStorage {
}

extension UInt64: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = UInt64

Expand Down Expand Up @@ -3464,6 +3471,7 @@ extension UInt64.AtomicRepresentation: AtomicIntegerStorage {
}

extension UInt32: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = UInt32

Expand Down Expand Up @@ -3956,6 +3964,7 @@ extension UInt32.AtomicRepresentation: AtomicIntegerStorage {
}

extension UInt16: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = UInt16

Expand Down Expand Up @@ -4448,6 +4457,7 @@ extension UInt16.AtomicRepresentation: AtomicIntegerStorage {
}

extension UInt8: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = UInt8

Expand Down Expand Up @@ -4943,6 +4953,7 @@ extension UInt8.AtomicRepresentation: AtomicIntegerStorage {
// on Linux distributions, and we cannot currently enable them automatically.
#if !(os(Linux) && arch(x86_64)) || ENABLE_DOUBLEWIDE_ATOMICS
extension DoubleWord: AtomicValue {
@frozen
public struct AtomicRepresentation {
public typealias Value = DoubleWord

Expand Down

0 comments on commit 59f7fbf

Please sign in to comment.