Skip to content

Commit 13c1391

Browse files
committed
SwiftShims: restrict AArch64 workaround to C++
`RefCount.h` can be included in a C context - e.g. building the SwiftShims module. Restrict the C++ overloads to the C++ context only. This partially improves the build for Windows ARM64.
1 parent b0f30c8 commit 13c1391

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/SwiftShims/RefCount.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,7 @@ _Static_assert(_Alignof(InlineRefCounts) == _Alignof(__swift_uintptr_t),
14961496
#endif
14971497

14981498
#if defined(_WIN32) && defined(_M_ARM64)
1499+
#if defined(__cplusplus)
14991500
namespace std {
15001501
template <>
15011502
inline void _Atomic_storage<swift::SideTableRefCountBits, 16>::_Unlock() const noexcept {
@@ -1505,5 +1506,6 @@ inline void _Atomic_storage<swift::SideTableRefCountBits, 16>::_Unlock() const n
15051506
}
15061507
}
15071508
#endif
1509+
#endif
15081510

15091511
#endif

0 commit comments

Comments
 (0)