From 4cf9136d76c76a2bc3cc40311ae142d20d5d5af0 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Tue, 11 Aug 2020 19:15:54 -0400 Subject: [PATCH] Fix DataTargetReader::AlignBase() (#28072) DAC_ALIGNAS macro was used to force MSVC and clang/gcc compilers layouts to match. Update DataTargetReader::AlignBase() assumptions based on new layouts --- src/md/datasource/datatargetreader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/md/datasource/datatargetreader.cpp b/src/md/datasource/datatargetreader.cpp index 3c32f61bce83..6c51db0b10d9 100644 --- a/src/md/datasource/datatargetreader.cpp +++ b/src/md/datasource/datatargetreader.cpp @@ -163,13 +163,10 @@ void DataTargetReader::Align(DWORD alignmentBytes) void DataTargetReader::AlignBase() { -#ifdef _MSC_VER - // Windows MSVC compiler aligns structs based on the largest field size + // Align structs based on the largest field size + // This is the default for MSVC compilers + // This is forced on other platforms by the DAC_ALIGNAS macro Align(m_currentStructureAlign); -#else - // clang (on all platforms) aligns structs always on 4 byte boundaries - Align(4); -#endif } HRESULT DataTargetReader::GetRemotePointerSize(ULONG32* pPointerSize)