From 306b9017d4e42f0035582a7479a112e67a2805c3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 3 Mar 2023 16:06:02 +0900 Subject: [PATCH] deps: cherry-pick win/arm64/clang fixes Refs: https://github.com/ngtcp2/nghttp3/pull/112 Refs: https://github.com/ngtcp2/ngtcp2/pull/692 Refs: https://github.com/HdrHistogram/HdrHistogram_c/pull/114 --- deps/histogram/src/hdr_atomic.h | 2 +- deps/histogram/src/hdr_histogram.c | 4 ++-- deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c | 2 +- deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps/histogram/src/hdr_atomic.h b/deps/histogram/src/hdr_atomic.h index ae1056a83612af..fb4af10f8589d0 100644 --- a/deps/histogram/src/hdr_atomic.h +++ b/deps/histogram/src/hdr_atomic.h @@ -8,7 +8,7 @@ #define HDR_ATOMIC_H__ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) #include #include diff --git a/deps/histogram/src/hdr_histogram.c b/deps/histogram/src/hdr_histogram.c index 4bcfbeb049bf59..e3ded0ab9b59d5 100644 --- a/deps/histogram/src/hdr_histogram.c +++ b/deps/histogram/src/hdr_histogram.c @@ -127,7 +127,7 @@ static int64_t power(int64_t base, int64_t exp) return result; } -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) # if defined(_WIN64) # pragma intrinsic(_BitScanReverse64) # else @@ -137,7 +137,7 @@ static int64_t power(int64_t base, int64_t exp) static int32_t count_leading_zeros_64(int64_t value) { -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) uint32_t leading_zero = 0; #if defined(_WIN64) _BitScanReverse64(&leading_zero, value); diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c index 9ea91c81c8a1b9..5e7775f1a5a597 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c @@ -33,7 +33,7 @@ #include "nghttp3_macro.h" -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64)) unsigned int __popcnt(unsigned int x) { unsigned int c = 0; for (; x; ++c) { diff --git a/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c b/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c index a6b3f73e73339c..74e488bce76f24 100644 --- a/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c +++ b/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c @@ -31,7 +31,7 @@ #include "ngtcp2_macro.h" -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64)) unsigned int __popcnt(unsigned int x) { unsigned int c = 0; for (; x; ++c) {