Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/external/abseil-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ else()
endif()

if(Patch_FOUND AND WIN32)
set(ABSL_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/abseil/absl_windows.patch)
set(ABSL_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/abseil/absl_windows.patch &&
${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/abseil/absl_cuda_warnings.patch)
else()
set(ABSL_PATCH_COMMAND "")
endif()
Expand Down
40 changes: 40 additions & 0 deletions cmake/patches/abseil/absl_cuda_warnings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
index 1234567..abcdefg 100644
--- a/absl/hash/internal/hash.h
+++ b/absl/hash/internal/hash.h
@@ -477,7 +477,7 @@ H AbslHashValue(H hash_state, T (&)[N]) {
template <typename H, typename T, size_t N>
H AbslHashValue(H hash_state, T (&)[N]) {
static_assert(
- sizeof(T) == -1,
+ sizeof(T) == size_t(-1),
"Hashing C arrays is not allowed. For string literals, wrap the literal "
"in absl::string_view(). To hash the array contents, use "
"absl::MakeSpan() or make the array an std::array. To hash the array "
diff --git a/absl/hash/hash.h b/absl/hash/hash.h
index 1234567..abcdefg 100644
--- a/absl/hash/hash.h
+++ b/absl/hash/hash.h
@@ -333,7 +333,8 @@ class HashState : public hash_internal::HashStateBase<HashState> {
absl::enable_if_t<
std::is_base_of<hash_internal::HashStateBase<T>, T>::value, int> = 0>
static HashState Create(T* state) {
- HashState s;
+ HashState s = {};
+ (void)s;
s.Init(state);
return s;
}
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index 1234567..abcdefg 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -464,7 +464,7 @@ inline uint16_t NextSeed() {
inline uint16_t NextSeed() {
static_assert(PerTableSeed::kBitCount == 16);
thread_local uint16_t seed =
- static_cast<uint16_t>(reinterpret_cast<uintptr_t>(&seed));
+ static_cast<uint16_t>(reinterpret_cast<uintptr_t>(&seed) & 0xFFFFu);
seed += uint16_t{0xad53};
return seed;
}
40 changes: 40 additions & 0 deletions cmake/vcpkg-ports/abseil/absl_cuda_warnings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
index 1234567..abcdefg 100644
--- a/absl/hash/internal/hash.h
+++ b/absl/hash/internal/hash.h
@@ -477,7 +477,7 @@ H AbslHashValue(H hash_state, T (&)[N]) {
template <typename H, typename T, size_t N>
H AbslHashValue(H hash_state, T (&)[N]) {
static_assert(
- sizeof(T) == -1,
+ sizeof(T) == size_t(-1),
"Hashing C arrays is not allowed. For string literals, wrap the literal "
"in absl::string_view(). To hash the array contents, use "
"absl::MakeSpan() or make the array an std::array. To hash the array "
diff --git a/absl/hash/hash.h b/absl/hash/hash.h
index 1234567..abcdefg 100644
--- a/absl/hash/hash.h
+++ b/absl/hash/hash.h
@@ -333,7 +333,8 @@ class HashState : public hash_internal::HashStateBase<HashState> {
absl::enable_if_t<
std::is_base_of<hash_internal::HashStateBase<T>, T>::value, int> = 0>
static HashState Create(T* state) {
- HashState s;
+ HashState s = {};
+ (void)s;
s.Init(state);
return s;
}
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index 1234567..abcdefg 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -464,7 +464,7 @@ inline uint16_t NextSeed() {
inline uint16_t NextSeed() {
static_assert(PerTableSeed::kBitCount == 16);
thread_local uint16_t seed =
- static_cast<uint16_t>(reinterpret_cast<uintptr_t>(&seed));
+ static_cast<uint16_t>(reinterpret_cast<uintptr_t>(&seed) & 0xFFFFu);
seed += uint16_t{0xad53};
return seed;
}
1 change: 1 addition & 0 deletions cmake/vcpkg-ports/abseil/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
SHA512 4ee1a217203933382e728d354a149253a517150eee7580a0abecc69584b2eb200d91933ef424487e3a3fe0e8ab5e77b0288485cac982171b3585314a4417e7d4
HEAD_REF master
PATCHES absl_windows.patch
absl_cuda_warnings.patch
)


Expand Down
Loading