cmemory-alignmentvisual-studio-6

What was default variable boundary alignment in Visual Studio 6?


I am trying to upgrade old Visual Studio 6 projects. They use "default" memory-boundary alignment. However, it seems that defaults for Visual Studio 6 and 2013 are not the same.

Anyone know what the old default was?
align(1) ?

(I need to know this since during the migration we will have a mix of programs. They communicate by serializing C-structs to byte-arrays and passing the array between programs. If the alignments are different that will fail horribly.)


Solution

  • According to MSDN "Structure Alignment" documentation:

    The default pack size for Windows 3.x is 2, whereas the default for Win32 is 8.

    Be aware that compiler options can be overridden with #pragma pack.