From 7fb43d7318347899c77f83cf3d97c413f8340e6b Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 15 Mar 2023 12:07:35 -0700 Subject: 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 --- absl/crc/internal/crc_memcpy_x86_64.cc | 28 ++++++++++++++-------------- 1 file 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 } -- cgit v1.2.3