Commit 090646f9 by Christian Fersch Committed by GitHub

Fix C++/CLI build problem (#916)

parent dcf48993
...@@ -404,7 +404,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>, ...@@ -404,7 +404,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>,
constexpr size_t Offset() const { constexpr size_t Offset() const {
static_assert(N < NumOffsets, "Index out of bounds"); static_assert(N < NumOffsets, "Index out of bounds");
return adl_barrier::Align( return adl_barrier::Align(
Offset<N - 1>() + SizeOf<ElementType<N - 1>>() * size_[N - 1], Offset<N - 1>() + SizeOf<ElementType<N - 1>>::value * size_[N - 1],
ElementAlignment<N>::value); ElementAlignment<N>::value);
} }
...@@ -597,7 +597,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>, ...@@ -597,7 +597,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>,
constexpr size_t AllocSize() const { constexpr size_t AllocSize() const {
static_assert(NumTypes == NumSizes, "You must specify sizes of all fields"); static_assert(NumTypes == NumSizes, "You must specify sizes of all fields");
return Offset<NumTypes - 1>() + return Offset<NumTypes - 1>() +
SizeOf<ElementType<NumTypes - 1>>() * size_[NumTypes - 1]; SizeOf<ElementType<NumTypes - 1>>::value * size_[NumTypes - 1];
} }
// If built with --config=asan, poisons padding bytes (if any) in the // If built with --config=asan, poisons padding bytes (if any) in the
...@@ -621,7 +621,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>, ...@@ -621,7 +621,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>,
// The `if` is an optimization. It doesn't affect the observable behaviour. // The `if` is an optimization. It doesn't affect the observable behaviour.
if (ElementAlignment<N - 1>::value % ElementAlignment<N>::value) { if (ElementAlignment<N - 1>::value % ElementAlignment<N>::value) {
size_t start = size_t start =
Offset<N - 1>() + SizeOf<ElementType<N - 1>>() * size_[N - 1]; Offset<N - 1>() + SizeOf<ElementType<N - 1>>::value * size_[N - 1];
ASAN_POISON_MEMORY_REGION(p + start, Offset<N>() - start); ASAN_POISON_MEMORY_REGION(p + start, Offset<N>() - start);
} }
#endif #endif
...@@ -645,7 +645,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>, ...@@ -645,7 +645,7 @@ class LayoutImpl<std::tuple<Elements...>, absl::index_sequence<SizeSeq...>,
// produce "unsigned*" where another produces "unsigned int *". // produce "unsigned*" where another produces "unsigned int *".
std::string DebugString() const { std::string DebugString() const {
const auto offsets = Offsets(); const auto offsets = Offsets();
const size_t sizes[] = {SizeOf<ElementType<OffsetSeq>>()...}; const size_t sizes[] = {SizeOf<ElementType<OffsetSeq>>::value...};
const std::string types[] = { const std::string types[] = {
adl_barrier::TypeName<ElementType<OffsetSeq>>()...}; adl_barrier::TypeName<ElementType<OffsetSeq>>()...};
std::string res = absl::StrCat("@0", types[0], "(", sizes[0], ")"); std::string res = absl::StrCat("@0", types[0], "(", sizes[0], ")");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment