Protect _pointerBitWidth conditionals from misparsing on older Swifts

This commit is contained in:
Karoy Lorentey committed 2023-09-25 19:42:22 -07:00
1 parent 8189a83f1c
commit d976dd29ad
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
+2 -2
View File
@@ -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 {