Skip to content

Commit 1f6a86f

Browse files
committed
Start using _pointerBitWidth in 5.9+
1 parent d75ef1b commit 1f6a86f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Sources/Atomics/autogenerated/IntegerConformances.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ extension UInt.AtomicRepresentation: AtomicIntegerStorage {
20922092

20932093

20942094

2095-
#if arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)
2095+
#if (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)))
20962096
extension DoubleWord: AtomicValue {
20972097
@frozen
20982098
public struct AtomicRepresentation {
@@ -2229,7 +2229,7 @@ extension DoubleWord.AtomicRepresentation: AtomicStorage {
22292229

22302230

22312231

2232-
#else /* arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32) */
2232+
#else /* (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32))) */
22332233
extension DoubleWord: AtomicValue {
22342234
@frozen
22352235
public struct AtomicRepresentation {
@@ -2363,5 +2363,5 @@ extension DoubleWord.AtomicRepresentation: AtomicStorage {
23632363
}
23642364
}
23652365

2366-
#endif /* arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32) */
2366+
#endif /* (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32))) */
23672367

Sources/Atomics/autogenerated/Primitives.native.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#if ATOMICS_NATIVE_BUILTINS
2222
import Builtin
2323

24-
#if arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)
24+
#if (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)))
2525
@frozen
2626
@_alignment(8)
2727
public struct DoubleWord {
@@ -2150,7 +2150,7 @@ extension UnsafeMutablePointer where Pointee == Int64 {
21502150
}
21512151
}
21522152

2153-
#if arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)
2153+
#if (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)))
21542154
extension UnsafeMutablePointer where Pointee == Int {
21552155
/// Atomically loads a word starting at this address with the specified
21562156
/// memory ordering.
@@ -2663,7 +2663,7 @@ extension UnsafeMutablePointer where Pointee == Int {
26632663
}
26642664
}
26652665

2666-
#else /* arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32) */
2666+
#else /* (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32))) */
26672667
extension UnsafeMutablePointer where Pointee == Int {
26682668
/// Atomically loads a word starting at this address with the specified
26692669
/// memory ordering.
@@ -3175,8 +3175,8 @@ extension UnsafeMutablePointer where Pointee == Int {
31753175
}
31763176
}
31773177
}
3178-
#endif /* arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32) */
3179-
#if arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)
3178+
#endif /* (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32))) */
3179+
#if (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)))
31803180
extension UnsafeMutablePointer where Pointee == DoubleWord {
31813181
/// Atomically loads a word starting at this address with the specified
31823182
/// memory ordering.
@@ -3493,7 +3493,7 @@ extension UnsafeMutablePointer where Pointee == DoubleWord {
34933493

34943494
}
34953495

3496-
#else /* arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32) */
3496+
#else /* (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32))) */
34973497
extension UnsafeMutablePointer where Pointee == DoubleWord {
34983498
/// Atomically loads a word starting at this address with the specified
34993499
/// memory ordering.
@@ -3809,5 +3809,5 @@ extension UnsafeMutablePointer where Pointee == DoubleWord {
38093809
}
38103810

38113811
}
3812-
#endif /* arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32) */
3812+
#endif /* (compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32))) */
38133813
#endif // ATOMICS_NATIVE_BUILTINS

Utilities/gyb_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def lowerFirst(str):
129129
def argLabel(label):
130130
return label + ": " if label != "_" else ""
131131

132-
ptrBitWidth32 = "arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)"
132+
ptrBitWidth32 = "(compiler(>=5.9) && _pointerBitWidth(_32)) || (compiler(<5.9) && (arch(i386) || arch(arm) || arch(arm64_32) || arch(wasm32)))"
133133

134134
def bitwidth_variants(value64, value32):
135135
if value64 == value32:

0 commit comments

Comments
 (0)