Skip to content

Commit d976dd2

Browse files
committed
Protect _pointerBitWidth conditionals from misparsing on older Swifts
1 parent 8189a83 commit d976dd2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/Atomics/Primitives/Primitives.native.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal func _atomicMemoryFence(
3939
% for (swiftType, builtinType, alignment) in nativePrimitives:
4040

4141
% if builtinType == "Int128":
42-
#if _pointerBitWidth(_64)
42+
#if compiler(>=5.9) && _pointerBitWidth(_64)
4343
% end
4444
@usableFromInline
4545
@frozen
@@ -267,10 +267,10 @@ extension UnsafeMutablePointer where Pointee == ${swiftType} {
267267
% end
268268
% end
269269

270-
#if _pointerBitWidth(_64)
270+
#if compiler(>=5.9) && _pointerBitWidth(_64)
271271
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt64Storage
272272
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt128Storage
273-
#elseif _pointerBitWidth(_32)
273+
#elseif compiler(>=5.9) && _pointerBitWidth(_32)
274274
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt32Storage
275275
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt64Storage
276276
#else

Sources/Atomics/Primitives/autogenerated/Primitives.native.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ extension UnsafeMutablePointer where Pointee == _AtomicInt64Storage {
21102110
}
21112111
}
21122112

2113-
#if _pointerBitWidth(_64)
2113+
#if compiler(>=5.9) && _pointerBitWidth(_64)
21142114
@usableFromInline
21152115
@frozen
21162116
@_alignment(16)
@@ -2438,10 +2438,10 @@ extension UnsafeMutablePointer where Pointee == _AtomicInt128Storage {
24382438
}
24392439
#endif
24402440

2441-
#if _pointerBitWidth(_64)
2441+
#if compiler(>=5.9) && _pointerBitWidth(_64)
24422442
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt64Storage
24432443
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt128Storage
2444-
#elseif _pointerBitWidth(_32)
2444+
#elseif compiler(>=5.9) && _pointerBitWidth(_32)
24452445
@usableFromInline internal typealias _AtomicIntStorage = _AtomicInt32Storage
24462446
@usableFromInline internal typealias _AtomicDoubleWordStorage = _AtomicInt64Storage
24472447
#else

Sources/Atomics/Types/DoubleWord.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#if ATOMICS_NATIVE_BUILTINS
1414
import Builtin
1515

16-
#if _pointerBitWidth(_32)
16+
#if compiler(>=5.9) && _pointerBitWidth(_32)
1717
@frozen
1818
@_alignment(8)
1919
public struct DoubleWord {
@@ -29,7 +29,7 @@ public struct DoubleWord {
2929
self.second = second
3030
}
3131
}
32-
#elseif _pointerBitWidth(_64)
32+
#elseif compiler(>=5.9) && _pointerBitWidth(_64)
3333
@frozen
3434
@_alignment(16)
3535
public struct DoubleWord {

0 commit comments

Comments
 (0)