From 77c4da6af9b7cb88ec171123d4bf4984f76edcce Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Wed, 1 Sep 2021 16:24:31 -0700 Subject: [PATCH] Convert the check for stdatomic.h into a compile step as opposed to an existance check. This is done because MSVC's STL provides the file as compilable for C++23 but not currently for C11/C17. --- src/coreclr/pal/src/libunwind/configure.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coreclr/pal/src/libunwind/configure.cmake b/src/coreclr/pal/src/libunwind/configure.cmake index e721db79f403b1..00d0d4dff088fb 100644 --- a/src/coreclr/pal/src/libunwind/configure.cmake +++ b/src/coreclr/pal/src/libunwind/configure.cmake @@ -17,8 +17,7 @@ if(CLR_CMAKE_HOST_WIN32) endif (NOT HAVE_STDALIGN_H) # MSVC compiler is currently missing C11 stdatomic.h header - # Fake it until support is added - check_include_files(stdatomic.h HAVE_STDATOMIC_H) + check_c_source_compiles("#include void main() { _Atomic int a; }" HAVE_STDATOMIC_H) if (NOT HAVE_STDATOMIC_H) configure_file(include/win/fakestdatomic.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/stdatomic.h COPYONLY) endif (NOT HAVE_STDATOMIC_H)