Skip to content

Commit 8d1847e

Browse files
authored
Merge pull request swiftlang#28942 from compnerd/non-standard
SwiftShims: unify assertion paths (NFC)
2 parents 87fc8f4 + beafad9 commit 8d1847e

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

stdlib/public/SwiftShims/RefCount.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,25 +1475,13 @@ HeapObject* RefCounts<SideTableRefCountBits>::getHeapObject() {
14751475
// for use by SWIFT_HEAPOBJECT_NON_OBJC_MEMBERS
14761476
typedef swift::InlineRefCounts InlineRefCounts;
14771477

1478-
// __cplusplus
1479-
#endif
1480-
14811478
// These assertions apply to both the C and the C++ declarations.
1482-
#if defined(_MSC_VER) && !defined(__clang__)
14831479
static_assert(sizeof(InlineRefCounts) == sizeof(InlineRefCountsPlaceholder),
14841480
"InlineRefCounts and InlineRefCountsPlaceholder must match");
14851481
static_assert(sizeof(InlineRefCounts) == sizeof(__swift_uintptr_t),
14861482
"InlineRefCounts must be pointer-sized");
14871483
static_assert(__alignof(InlineRefCounts) == __alignof(__swift_uintptr_t),
14881484
"InlineRefCounts must be pointer-aligned");
1489-
#else
1490-
_Static_assert(sizeof(InlineRefCounts) == sizeof(InlineRefCountsPlaceholder),
1491-
"InlineRefCounts and InlineRefCountsPlaceholder must match");
1492-
_Static_assert(sizeof(InlineRefCounts) == sizeof(__swift_uintptr_t),
1493-
"InlineRefCounts must be pointer-sized");
1494-
_Static_assert(_Alignof(InlineRefCounts) == _Alignof(__swift_uintptr_t),
1495-
"InlineRefCounts must be pointer-aligned");
1496-
#endif
14971485

14981486
#if defined(_WIN32) && defined(_M_ARM64)
14991487
#if defined(__cplusplus)
@@ -1508,4 +1496,6 @@ inline void _Atomic_storage<swift::SideTableRefCountBits, 16>::_Unlock() const n
15081496
#endif
15091497
#endif
15101498

1499+
#endif // !defined(__swift__)
1500+
15111501
#endif

0 commit comments

Comments
 (0)