Skip to content

Conversation

@compnerd
Copy link
Member

The 14.31.30818 toolset has the following in the stdatomic.h:

 #ifndef __cplusplus
 #error <stdatomic.h> is not yet supported when compiling as C, but this is planned for a future release.
 #endif

This results in clang failing to build existing code which relied on
stdatomic.h in C mode on Windows. Simply fallback to the clang header
until that header is available as a complete implementation.

(cherry picked from commit 1ad7de9)
(cherry picked from commit 74483fb)

The 14.31.30818 toolset has the following in the `stdatomic.h`:
~~~
 #ifndef __cplusplus
 #error <stdatomic.h> is not yet supported when compiling as C, but this is planned for a future release.
 #endif
~~~

This results in clang failing to build existing code which relied on
`stdatomic.h` in C mode on Windows.  Simply fallback to the clang header
until that header is available as a complete implementation.

(cherry picked from commit 1ad7de9)
(cherry picked from commit 74483fb)
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

Backporting this from stable/20210726 to aid with builds with the newer MSVC toolset which prevents the inclusion of the MSVC atomic.h

@compnerd
Copy link
Member Author

CC: @shahmishal

@compnerd compnerd changed the title Headers: exclude #include_next <stdatomic.h> on MSVC [5.5] Headers: exclude #include_next <stdatomic.h> on MSVC Jan 20, 2022
@shahmishal shahmishal merged commit 450ca43 into swiftlang:swift/release/5.5 Jan 20, 2022
@compnerd compnerd deleted the 5.5-atomicity branch January 20, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants