Skip to content

Commit

Permalink
Make the code build
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalPetryka committed Jan 26, 2024
1 parent c3cf1c4 commit 492ed0e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/coreclr/pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,17 @@ check_cxx_symbol_exists(_SC_PHYS_PAGES unistd.h HAVE__SC_PHYS_PAGES)
check_cxx_symbol_exists(_SC_AVPHYS_PAGES unistd.h HAVE__SC_AVPHYS_PAGES)

check_c_source_compiles("
//#if defined(__clang__) || defined(_MSC_VER)
//int main(void) {
// return 0;
//}
//#else
#include <stdatomic.h>
int main(void) {
#if ATOMIC_CHAR_LOCK_FREE == 2 && ATOMIC_SHORT_LOCK_FREE == 2 && ATOMIC_INT_LOCK_FREE == 2 && ATOMIC_LLONG_LOCK_FREE == 2
#if defined(__clang__) && __has_builtin(__sync_swap) && __has_builtin(__sync_val_compare_and_swap)
return 0;
#elif ATOMIC_CHAR_LOCK_FREE == 2 && ATOMIC_SHORT_LOCK_FREE == 2 && ATOMIC_INT_LOCK_FREE == 2 && ATOMIC_LLONG_LOCK_FREE == 2
return 0;
#else
#error CoreCLR requires non-locking atomics
#endif
}
//#endif" HAVE_LOCKFREE_ATOMICS)
}" HAVE_LOCKFREE_ATOMICS)

if(NOT HAVE_LOCKFREE_ATOMICS)
message( FATAL_ERROR "CoreCLR requires non-locking atomics" )
Expand Down

0 comments on commit 492ed0e

Please sign in to comment.