Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Fix DataTargetReader::AlignBase() (#28072)
Browse files Browse the repository at this point in the history
DAC_ALIGNAS macro was used to force MSVC and clang/gcc
compilers layouts to match.  Update DataTargetReader::AlignBase()
assumptions based on new layouts
  • Loading branch information
sdmaclea authored Aug 11, 2020
1 parent 8291bb8 commit 4cf9136
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/md/datasource/datatargetreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4cf9136

Please sign in to comment.