From c31fd2cfcded48016ad40a502db844293e621836 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 6 Aug 2024 11:43:58 -0700 Subject: [PATCH 1/2] [windows] do not import stdatomic on windows as it doesn't work with c++ interop enabled Works around https://github.com/swiftlang/swift/issues/75720 --- Sources/_FoundationCShims/include/_CStdlib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/_FoundationCShims/include/_CStdlib.h b/Sources/_FoundationCShims/include/_CStdlib.h index 8967eb7f4..5c64850d8 100644 --- a/Sources/_FoundationCShims/include/_CStdlib.h +++ b/Sources/_FoundationCShims/include/_CStdlib.h @@ -122,9 +122,15 @@ #include #endif +#if !defined(_WIN32) +// On windows, atomic_signal_fence from clang headers is incompatible +// with atomic_signal_fence definition from MSVC when C++ interop is enabled, +// so drop the stdatomic include. +// Works around: https://github.com/swiftlang/swift/issues/75720 #if __has_include() #include #endif +#endif #if __has_include() #include From 3b76d4610ed1caa01bcc2d5ad136f62342418b99 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 6 Aug 2024 15:23:10 -0700 Subject: [PATCH 2/2] remove the stdatomic include alltogether --- Sources/_FoundationCShims/include/_CStdlib.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Sources/_FoundationCShims/include/_CStdlib.h b/Sources/_FoundationCShims/include/_CStdlib.h index 5c64850d8..04bb7287e 100644 --- a/Sources/_FoundationCShims/include/_CStdlib.h +++ b/Sources/_FoundationCShims/include/_CStdlib.h @@ -122,16 +122,6 @@ #include #endif -#if !defined(_WIN32) -// On windows, atomic_signal_fence from clang headers is incompatible -// with atomic_signal_fence definition from MSVC when C++ interop is enabled, -// so drop the stdatomic include. -// Works around: https://github.com/swiftlang/swift/issues/75720 -#if __has_include() -#include -#endif -#endif - #if __has_include() #include #endif