mirror of
https://github.com/apple/swift-atomics
synced 2026-11-22 04:20:39 +00:00
Protect _pointerBitWidth conditionals from misparsing on older Swifts
This commit is contained in:
3 files changed
+8
-8
No files matched your search
@@ -39,7 +39,7 @@ internal func _atomicMemoryFence(
|
||||
% for (swiftType, builtinType, alignment) in nativePrimitives:
|
||||
|
||||
% if builtinType == "Int128":
|
||||
#if _pointerBitWidth(_64)
|
||||
#if compiler(>=5.9) && _pointerBitWidth(_64)
|
||||
% end
|
||||
@usableFromInline
|
||||
@frozen
|
||||
@@ -267,10 +267,10 @@ extension UnsafeMutablePointer where Pointee == ${swiftType} {
|
||||
% end
|
||||
% end
|
||||
|
||||
#if _pointerBitWidth(_64)
|
||||
#if compiler(>=5.9) && _pointerBitWidth(_64)
|
||||
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt64Storage
|
||||
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt128Storage
|
||||
#elseif _pointerBitWidth(_32)
|
||||
#elseif compiler(>=5.9) && _pointerBitWidth(_32)
|
||||
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt32Storage
|
||||
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt64Storage
|
||||
#else
|
||||
|
||||
@@ -2110,7 +2110,7 @@ extension UnsafeMutablePointer where Pointee == _AtomicInt64Storage {
|
||||
}
|
||||
}
|
||||
|
||||
#if _pointerBitWidth(_64)
|
||||
#if compiler(>=5.9) && _pointerBitWidth(_64)
|
||||
@usableFromInline
|
||||
@frozen
|
||||
@_alignment(16)
|
||||
@@ -2438,10 +2438,10 @@ extension UnsafeMutablePointer where Pointee == _AtomicInt128Storage {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if _pointerBitWidth(_64)
|
||||
#if compiler(>=5.9) && _pointerBitWidth(_64)
|
||||
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt64Storage
|
||||
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt128Storage
|
||||
#elseif _pointerBitWidth(_32)
|
||||
#elseif compiler(>=5.9) && _pointerBitWidth(_32)
|
||||
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt32Storage
|
||||
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt64Storage
|
||||
#else
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#if ATOMICS_NATIVE_BUILTINS
|
||||
import Builtin
|
||||
|
||||
#if _pointerBitWidth(_32)
|
||||
#if compiler(>=5.9) && _pointerBitWidth(_32)
|
||||
@frozen
|
||||
@_alignment(8)
|
||||
public struct DoubleWord {
|
||||
@@ -29,7 +29,7 @@ public struct DoubleWord {
|
||||
self.second = second
|
||||
}
|
||||
}
|
||||
#elseif _pointerBitWidth(_64)
|
||||
#elseif compiler(>=5.9) && _pointerBitWidth(_64)
|
||||
@frozen
|
||||
@_alignment(16)
|
||||
public struct DoubleWord {
|
||||
|
||||
Reference in new issue
Block a user