From 06f1a1aa5e63c0976c207e77233c5a9e71eb3fc9 Mon Sep 17 00:00:00 2001 From: Cesare Ferrari Date: Mon, 6 Jan 2025 12:57:55 +0000 Subject: [PATCH] Add windows/arm64 support, ensure unsupported platforms see a compile error --- include/crill/bytewise_atomic_memcpy.h | 4 +++- include/crill/impl/progressive_backoff_wait_impl.h | 6 +++++- include/crill/platform.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/crill/bytewise_atomic_memcpy.h b/include/crill/bytewise_atomic_memcpy.h index 449aaae..23ff378 100644 --- a/include/crill/bytewise_atomic_memcpy.h +++ b/include/crill/bytewise_atomic_memcpy.h @@ -42,11 +42,12 @@ namespace crill { for (std::size_t i = 0; i < count; ++i) { #if __cpp_lib_atomic_ref - dest_bytes[i] = std::atomic_ref(src_bytes[i]).load(std::memory_order_relaxed); + dest_bytes[i] = std::atomic_ref(src_bytes[i]).load(std::memory_order_relaxed); #elif CRILL_CLANG || CRILL_GCC dest_bytes[i] = __atomic_load_n(src_bytes + i, __ATOMIC_RELAXED); #else // No atomic_ref or equivalent functionality available on this platform! + #error "Platform not supported!" #endif } @@ -81,6 +82,7 @@ namespace crill { __atomic_store_n(dest_bytes + i, src_bytes[i], __ATOMIC_RELAXED); #else // No atomic_ref or equivalent functionality available on this platform! + #error "Platform not supported!" #endif } diff --git a/include/crill/impl/progressive_backoff_wait_impl.h b/include/crill/impl/progressive_backoff_wait_impl.h index 80d17d9..35681af 100644 --- a/include/crill/impl/progressive_backoff_wait_impl.h +++ b/include/crill/impl/progressive_backoff_wait_impl.h @@ -11,7 +11,11 @@ #if CRILL_INTEL #include #elif CRILL_ARM_64BIT - #include + #ifdef _WIN32 + #include + #else + #include + #endif #endif namespace crill::impl diff --git a/include/crill/platform.h b/include/crill/platform.h index a25fb99..9a9ca51 100644 --- a/include/crill/platform.h +++ b/include/crill/platform.h @@ -11,7 +11,7 @@ #define CRILL_ARM 1 #define CRILL_32BIT 1 #define CRILL_ARM_32BIT 1 -#elif defined (__arm64__) +#elif defined (__arm64__) || defined (_M_ARM64) #define CRILL_ARM 1 #define CRILL_64BIT 1 #define CRILL_ARM_64BIT 1