summaryrefslogtreecommitdiff
path: root/absl/crc
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2023-03-15 12:07:35 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-03-15 12:08:34 -0700
commit7fb43d7318347899c77f83cf3d97c413f8340e6b (patch)
treef541137f14e82d9b4e8dc4ac628d3bb77cd47444 /absl/crc
parente5b65f172a2fbf488dc1927d86c8f3671d6b032f (diff)
Workaround for MSVC warning that designated initializers are a C++20 feature
https://google.github.io/styleguide/cppguide.html#Designated_initializers recommends using designated initializers as does https://abseil.io/tips/172, but apparently they are a non-standard extension prior to C++20. For maximum compatibility, avoid using them here. Fixes #1413 PiperOrigin-RevId: 516892890 Change-Id: Id7b7857891e39eb52132c3edf70e5bf4973755af
Diffstat (limited to 'absl/crc')
-rw-r--r--absl/crc/internal/crc_memcpy_x86_64.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/absl/crc/internal/crc_memcpy_x86_64.cc b/absl/crc/internal/crc_memcpy_x86_64.cc
index 0078f0e8..d42b08dc 100644
--- a/absl/crc/internal/crc_memcpy_x86_64.cc
+++ b/absl/crc/internal/crc_memcpy_x86_64.cc
@@ -357,18 +357,18 @@ CrcMemcpy::ArchSpecificEngines CrcMemcpy::GetArchSpecificEngines() {
case CpuType::kIntelHaswell:
case CpuType::kIntelIvybridge:
return {
- .temporal = new FallbackCrcMemcpyEngine(),
- .non_temporal = new CrcNonTemporalMemcpyAVXEngine(),
+ /*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
};
// INTEL_SANDYBRIDGE performs better with SSE than AVX.
case CpuType::kIntelSandybridge:
return {
- .temporal = new FallbackCrcMemcpyEngine(),
- .non_temporal = new CrcNonTemporalMemcpyEngine(),
+ /*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyEngine(),
};
default:
- return {.temporal = new FallbackCrcMemcpyEngine(),
- .non_temporal = new FallbackCrcMemcpyEngine()};
+ return {/*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new FallbackCrcMemcpyEngine()};
}
#else
// Get the underlying architecture.
@@ -386,8 +386,8 @@ CrcMemcpy::ArchSpecificEngines CrcMemcpy::GetArchSpecificEngines() {
case CpuType::kAmdRome:
case CpuType::kAmdNaples:
return {
- .temporal = new AcceleratedCrcMemcpyEngine<1, 2>(),
- .non_temporal = new CrcNonTemporalMemcpyAVXEngine(),
+ /*.temporal=*/new AcceleratedCrcMemcpyEngine<1, 2>(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
};
// PCLMULQDQ is slow and we don't have wide enough issue width to take
// advantage of it. For an unknown architecture, don't risk using CLMULs.
@@ -398,18 +398,18 @@ CrcMemcpy::ArchSpecificEngines CrcMemcpy::GetArchSpecificEngines() {
case CpuType::kIntelHaswell:
case CpuType::kIntelIvybridge:
return {
- .temporal = new AcceleratedCrcMemcpyEngine<3, 0>(),
- .non_temporal = new CrcNonTemporalMemcpyAVXEngine(),
+ /*.temporal=*/new AcceleratedCrcMemcpyEngine<3, 0>(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyAVXEngine(),
};
// INTEL_SANDYBRIDGE performs better with SSE than AVX.
case CpuType::kIntelSandybridge:
return {
- .temporal = new AcceleratedCrcMemcpyEngine<3, 0>(),
- .non_temporal = new CrcNonTemporalMemcpyEngine(),
+ /*.temporal=*/new AcceleratedCrcMemcpyEngine<3, 0>(),
+ /*.non_temporal=*/new CrcNonTemporalMemcpyEngine(),
};
default:
- return {.temporal = new FallbackCrcMemcpyEngine(),
- .non_temporal = new FallbackCrcMemcpyEngine()};
+ return {/*.temporal=*/new FallbackCrcMemcpyEngine(),
+ /*.non_temporal=*/new FallbackCrcMemcpyEngine()};
}
#endif // UNDEFINED_BEHAVIOR_SANITIZER
}